[solved] "All"-File management / database with text files in the directory tree for linux
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- thomas-neemann
- Veteran
- Posts: 11915
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
[solved] "All"-File management / database with text files in the directory tree for linux
i am trying to create a database for freecad files. an editor with roughly this template
should appear when saving
a text file will automatically be created with the same name as the freecad file. For example: 20210001a.fcstd and 20210001a.txt
there will be a search command, e.g. with this entry Staus: E Name: thne show all files with paths in which all conditions are met.
If you have any further ideas or suggestions, please post here
Greetings Thomas
should appear when saving
a text file will automatically be created with the same name as the freecad file. For example: 20210001a.fcstd and 20210001a.txt
there will be a search command, e.g. with this entry Staus: E Name: thne show all files with paths in which all conditions are met.
If you have any further ideas or suggestions, please post here
Greetings Thomas
Last edited by thomas-neemann on Wed Nov 17, 2021 7:43 am, edited 2 times in total.
- thomas-neemann
- Veteran
- Posts: 11915
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: File management / database with text files in the directory tree for linux
there is a nice search program: recoll.
ubuntu-installation: sudo apt-get install recoll python xsltproc unzip
this allows you to enter several search terms and filter them very well. here's an example.
ubuntu-installation: sudo apt-get install recoll python xsltproc unzip
this allows you to enter several search terms and filter them very well. here's an example.
Re: File management / database with text files in the directory tree for linux
Ok for text files (I'm a UNIX user so "plain text files, human readable" are the best in my opinion).
But what you will intend to do?
A sort of indexing system for FreeCAD files, or something like a Macro that will scan some directories to find a "category of files" that "have same features"?
Maybe FreeCAD has some abilities to store Metadata on the file, had a discussion with Yorick about them some time ago, and there is a place on which you could put some metedata.
Obviously scanning for text file maybe with a pattern or a precise extension like (.FCmd) (FreeCAD meta data) will be something that Python could do even using the FileOpen windows of Qt in case of a rudimental GUI.
Regards
Carlo D.
But what you will intend to do?
A sort of indexing system for FreeCAD files, or something like a Macro that will scan some directories to find a "category of files" that "have same features"?
Maybe FreeCAD has some abilities to store Metadata on the file, had a discussion with Yorick about them some time ago, and there is a place on which you could put some metedata.
Obviously scanning for text file maybe with a pattern or a precise extension like (.FCmd) (FreeCAD meta data) will be something that Python could do even using the FileOpen windows of Qt in case of a rudimental GUI.
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- thomas-neemann
- Veteran
- Posts: 11915
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: File management / database with text files in the directory tree for linux
in my opinion it is easier because recoll already has this function
edit
quelle:
https://www.heise.de/ct/artikel/Toolbox ... 15658.html
Last edited by thomas-neemann on Tue Nov 16, 2021 10:13 am, edited 1 time in total.
Re: File management / database with text files in the directory tree for linux
Ok but what is the "scope" of this thing, make a sort of "project management"?
Let me explain better, if you intend to model a complex thing, you have to do many drawings so maybe you wnato to have a mean to "keep trace" of "drawing version", "creation date", "author" and so on?
Only to "focus" on the matter.
Regards
Carlo D.
Let me explain better, if you intend to model a complex thing, you have to do many drawings so maybe you wnato to have a mean to "keep trace" of "drawing version", "creation date", "author" and so on?
Only to "focus" on the matter.
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- thomas-neemann
- Veteran
- Posts: 11915
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: File management / database with text files in the directory tree for linux
yes, that's exactly what the macro is supposed to do. combined searches for creator, status, version etc. just like a professional cad database
Re: File management / database with text files in the directory tree for linux
It wil be a good addition.
but for a sort of this thing, I could suggest to use maybe a different approach.
As sqlite3 is a "on board" facility of Python, maybe using a squlite3 database to hold all the information if the project is big, it could be a more quick and "professional way".
sqlite3 database files are " a single file" that could be opened and processed, as it sqlite format could contain also binary blobs, images and other things could be added, like manuals, drawings, and so on.
It could be lead to some security problems, (as I was told when I have tried to suggest this format for some part of FreeCAD) but it wil be a thing that could be very handy.
Searches are simply text string containing "SQL Queries" and making complex things like:
I wanto to have all the document created by "person A" with the scope of "drawings" from date 01/01/1970 to date 01/01/1980 is simple as to write:
"SELECT drawing_file, author, drawing_number FROM FcData WHERE author = 'person A' AND date(creation_date)
BETWEEN date('1970-01-01') AND date('1980-01-01') AND scope="drawings" ;"
all without having to rely on "external libraries" as they are part of Standard Python see: https://docs.python.org/3/library/sqlite3.html
Regards
Carlo D.
but for a sort of this thing, I could suggest to use maybe a different approach.
As sqlite3 is a "on board" facility of Python, maybe using a squlite3 database to hold all the information if the project is big, it could be a more quick and "professional way".
sqlite3 database files are " a single file" that could be opened and processed, as it sqlite format could contain also binary blobs, images and other things could be added, like manuals, drawings, and so on.
It could be lead to some security problems, (as I was told when I have tried to suggest this format for some part of FreeCAD) but it wil be a thing that could be very handy.
Searches are simply text string containing "SQL Queries" and making complex things like:
I wanto to have all the document created by "person A" with the scope of "drawings" from date 01/01/1970 to date 01/01/1980 is simple as to write:
"SELECT drawing_file, author, drawing_number FROM FcData WHERE author = 'person A' AND date(creation_date)
BETWEEN date('1970-01-01') AND date('1980-01-01') AND scope="drawings" ;"
all without having to rely on "external libraries" as they are part of Standard Python see: https://docs.python.org/3/library/sqlite3.html
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- thomas-neemann
- Veteran
- Posts: 11915
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: File management / database with text files in the directory tree for linux
yes i have seen that often. The problem is, however, that when major software changes are made, the databases no longer work and all effort and time are lost.
therefore my suggestion is to work with text files that are named like the feecad files. i will make a video to explain it.
- thomas-neemann
- Veteran
- Posts: 11915
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: File management / database with text files in the directory tree for linux
here is a video simulation of what the workflow could look like
https://www.youtube.com/watch?v=8uBSU_ncp5w
edit
additions: variant management, open with data sheet.
edit 2
file locking
edit 3
Can be expanded as required: revision management, proof of use, etc.
Re: File management / database with text files in the directory tree for linux
As onekk wrote, a sql database is the way to go. But i would use postgresql, because sqlite is only a single file and will be to big in notime.
Also with a sql database you can solve the issue with locking a part. With sql someone can check out a part and give only the person the writing permission. Other people also can load the part (for example for assemblies), modify it, but have no writing permission.
Greetings
user1234
Also with a sql database you can solve the issue with locking a part. With sql someone can check out a part and give only the person the writing permission. Other people also can load the part (for example for assemblies), modify it, but have no writing permission.
Greetings
user1234