It seems that SCIA updated the format and now SAF tables are seamlessly integrated within the html. In any case, if you need an Excel file, you could run these Python lines from a local notebook or from Google Colab:
import pandas as pd
import requests
url = 'https://www.saf.guide/structural-analysis-elements/structuralmaterial'
url_content = requests.get(url).content # cannot use pandas directly because it is https
df = pd.read_html(url_content, header=0)[0]
df.to_excel(url.split('/')[-1] + '.xlsx')
CODE NOT WORKING!
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import pandas as pd
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'pandas'
import requests
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'requests'
@GRSOFT said:
Hi there,
what happened with SAF guide where we could download excel files? Please provide me feedback on this topic.
Best Regards, Primoz
Yes that is true. We moved to github platform and here we do not see possibility to embed excel sheets. Also it takes quite some effort to update these excels if we do modifications. What we will do is adding a chapter where we will have an example excel containing as much as possible all objects. Hope that helps.
@GRSOFT the script @cvillagrasa provided works, I have attached the excel file. You need to install pandas and requests (as well as lxml that was missing for my case but you will get an Error if that is the problem, so you will know) locally. Otherwise, with Collab I don't know, haven't used it so much.
However, I don't think that this is related to what you are looking for, as this is just the same table you see in the page, not an Excel file that has a valid SAF schema as it was the case before.
@Herman it would be great if you could have some example Excel files as part of the documentation
@Jesusbill said: @GRSOFT the script @cvillagrasa provided works, I have attached the excel file. You need to install pandas and requests (as well as lxml that was missing for my case but you will get an Error if that is the problem, so you will know) locally. Otherwise, with Collab I don't know, haven't used it so much.
However, I don't think that this is related to what you are looking for, as this is just the same table you see in the page, not an Excel file that has a valid SAF schema as it was the case before.
@Herman it would be great if you could have some example Excel files as part of the documentation
Are there any news for the reference implementation? I cannot use C# nor Python, because I write plain C and I don't want to depend on Python libraries nor in Windows/Mono, but, anyway, if there's a reference implementation in C# or Python I can use it as a starting point for my C tools
@zcanv said:
Are there any news for the reference implementation? I cannot use C# nor Python, because I write plain C and I don't want to depend on Python libraries nor in Windows/Mono, but, anyway, if there's a reference implementation in C# or Python I can use it as a starting point for my C tools
Comments
On this site for instance you have just Excel screenshots, but no example files to download
https://saf.guide/Default.htm#2_Project and model specifications.htm?TocPath=_____6
If you double check, you will see a download button on the displayed spreadsheets!
Thank you very much.
Primoz
Hi there,
what happened with SAF guide where we could download excel files? Please provide me feedback on this topic.
Best Regards, Primoz
It seems that SCIA updated the format and now SAF tables are seamlessly integrated within the html. In any case, if you need an Excel file, you could run these Python lines from a local notebook or from Google Colab:
CODE NOT WORKING!
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'pandas'
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'requests'
Traceback (most recent call last):
File "", line 1, in
NameError: name 'requests' is not defined
Traceback (most recent call last):
File "", line 1, in
NameError: name 'pd' is not defined
Just install pandas or use Colab, where it is already installed.
Yes that is true. We moved to github platform and here we do not see possibility to embed excel sheets. Also it takes quite some effort to update these excels if we do modifications. What we will do is adding a chapter where we will have an example excel containing as much as possible all objects. Hope that helps.
I tried Colab and run your script, but nothing happened. Other scripts are running without problem. Is there any problem with the code as I have no idea how to get Excel file? Please check the attachment:
https://drive.google.com/file/d/1q2A4oQBDtnTGXUz8zvwzHkwLlwI_ab-m/view?usp=sharing
Where should Excel file to be save as a result of running your code?
It is a result of our unit tests. We can put the result in the documentation.
Can you tell me what is then the purpose of running this code?
import pandas as pd
import requests
url = 'https://www.saf.guide/structural-analysis-elements/structuralmaterial'
url_content = requests.get(url).content # cannot use pandas directly because it is https
df = pd.read_html(url_content, header=0)[0]
df.to_excel(url.split('/')[-1] + '.xlsx')
I suppose it should create Excel file?
Yes sure.
How should I change this line?
df.to_excel(url.split('/')[-1] + '???????.xlsx')
To match my file or what?
@GRSOFT the script @cvillagrasa provided works, I have attached the excel file. You need to install
pandas
andrequests
(as well aslxml
that was missing for my case but you will get an Error if that is the problem, so you will know) locally. Otherwise, with Collab I don't know, haven't used it so much.However, I don't think that this is related to what you are looking for, as this is just the same table you see in the page, not an Excel file that has a valid SAF schema as it was the case before.
@Herman it would be great if you could have some example Excel files as part of the documentation
we do our best to do that asap.
By the way are you all aware of the free SAF viewer: https://autoconverter.structuraltoolkit.com/en-GB/saf-viewer
It can help you testing your models. We also do quite some validation when uploading.
Are there any news for the reference implementation? I cannot use C# nor Python, because I write plain C and I don't want to depend on Python libraries nor in Windows/Mono, but, anyway, if there's a reference implementation in C# or Python I can use it as a starting point for my C tools
We have recently published a C# SDK on nuget.org:
https://www.nuget.org/profiles/StructuralAnalysisFormat
Shame you can't use C#, but I hope it might be a source of inspiration for you :-)
Please update https://wiki.osarch.org/index.php?title=Structural_Analysis_Format_(SAF)
edit: thanks for making the update to the wiki @dschuermans !