-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Portable Use? #65
Comments
The PyPI install to be accessed through PIP is an extra feature that Lex requested. The repo works entirely independently it doesn't need to be installed by PIP you can just download the code and use that in any way you need or see fit. The Pip version doesn't include a few of the utility scripts you'd find in this repo like If that's what you mean by standalone then yes, the code is just here, has no requirements or need to be downloaded one way rather than another. |
You would just import the directory and start using it, the readme should give some pretty good explanations for a lot of them.
|
The pattern classes themselves also have a bunch of hooks to modify the data. You can access the stitches iterate through them, modify them in whatever ways you want, and save them out in whatever format you need. So a bit of script to modify the content of a .u01 file, it wouldn't be too hard to create a little utility to iterate through the various stitches and tell it to add a SLOW command here at stitch 303 and a FAST command here at stitch 402, then save the file out. Or hook it up as a backend to anything else that uses python.
If you find some part of the readme documentation lacking or confusing, say something. I don't really know what other people would need it for, so I built it for everything I could think of. But, the documentation might be confusing in places or not explain things well, and those bits would need polish but I won't know where they are because none of it confuses me. |
Well, what I'm trying to do now is a simple conversion. My ultimate goal is export CSV from Ink/Stitch to add in commands that may not be setup in Ink/Stitch right now in a text editor and then output a support file format from that. A little on the tedious side, but it should work. Mainly for sequins (always back to the sequins with me). I've downloads the zip file from the repo, extracted it to the location that I wanted it. I'm assuming everything is CLI, so I'm CD'ing into pyembroidery-master/pyembroidery. I'm trying to figure out the command string in it's entirety. For instance, if I'm going to use libembroidery-convert it would be after CD'ing to the location that the portable binary is in:
Or something along those lines. What would by the pyembroidery equivalent to that? Where would I need to CD into and the command string that I would use? Especially if it's different from what the command is if it's directly installed into the system. |
Hm. That's likely quite doable. But, it's mostly setup for scripting just now. I could certainly make that script it's like two lines. Though I've not messed with taking CLI data into a python script yet. |
Pretty easy, lemme code that up. |
Okay, added pyembroidery-convert.py. If you have python installed properly you can actually just drag a current embroidery on it, and it'll export the csv file even without command line interfacing. You just drag a file there, and get a csv. But, in CLI you can give it the output format too which can be .u01 or .exp or whatever you need. |
That appears to work with the test file for conversion that I had setup. Awesome! Thanks. |
@wwderw Since I know it might come up. I also added a CSV reader to pyembroidery a second ago. So you will be able to convert to CSV then find a line you care about, and add FAST and SLOW So export to CSV, change stuff a bit like:
Then convert that to .U01 and it'll have the fast and slow commands properly added. It should also work for Embroidermodder but I've not seen their CSV files kicking around but I only tweaked the thread to make them more readable and so I added a catch for that in the reader. |
Awesome. That will definitely come in handy. Thank you! |
If I manage to get the teaching .u01 files working, I might even be able to have you export .u01 and edit in both sequins and slows and fasts into the same file. But, that's a bit off the beaten path. Converting from sequins to .u01 will, currently, convert the sequins to jump stitches. Then you could edit them on the machine. But, it should certainly work standalone and let you edit the CSV now. I could also make a quick script to convert from CSV to all your standard chosen embroidery formats. Maybe you'd have some need to drop a file on the converter, get a csv, edit the csv and drop the csv on an exporter, and make the file types you usually export. |
Added the exporter. So if you drag a file of any format pyembroidery reads onto that script, even a modified .csv you'll get the standard file types you deal. They will be largely raw reads and writes so if there's some issue like dsts not producing trims explicitly and some other format exporting oddly it's due to that and the script could be tweaked to add some stablizing code to convert some number of jumps to a trim, etc. But you could drop a file on the converter, and it will default convert it to .csv then edit that .csv to add SLOW and FAST then drag the edited .csv on the exporter and boom... .u01 with fast and slow commands. |
Yes, I could do definitely come up with some use cases where that would come in handy. I do get a fair amount of people that want me to edit already purchased designs to tweak them to get what they exactly did and this would come in handy for that.
Awesome, I'll be looking forward to trying that out. |
Well, I already pushed it to main here, so you could try it now. It's really just a couple of lines of code in a file. Little utilities that do things like that are pretty trivial, given how everything is put together. |
It definitely exports all the main files. One thing that I noticed, it appears that the source file in question has to be in the same directory as the py file in order for it to work. It doesn't look like you can name a file outside that directory that has the py file being used. Otherwise, everything works as it should. That's pretty cool. |
There are clearly ways to fix that, basically you need to setup python to have the directory the script occupies set in the python path. Basically what's happening is the scripts I gave there have an import, "from pyembroidery import *" this means it needs to know what pyembroidery is and how to find it. There's a few ways to give it this information so it'll find it even without your python scripts in the main directory there. https://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows |
Is the repo able to be used as a standalone without having to traditionally install via PIP etc?
If it is, what would be the commands for the various functions by for portable use?
If it isn't as of now, would it be possible to have a portable version?
The text was updated successfully, but these errors were encountered: