glabels


Nameglabels JSON
Version 0.1.3 PyPI version JSON
download
home_page
SummarySimple wrapper around glabels-3-batch and glabels-batch-qt
upload_time2023-10-23 14:54:33
maintainer
docs_urlNone
authorNureev Insaf
requires_python>=3.7
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            This library is a simple wrapper around `glabels-3-batch` and `glabels-batch-qt` - extremely convenient utilities for creating labels from pre-created templates:

- Glabels-3 - https://github.com/jimevins/glabels
- Glabels-qt - https://github.com/jimevins/glabels-qt
# Installation  
  
```shell
pip install glabels
```  
  
# Usage  
### glabels-batch-qt  
  
```python  
from glabels import GLabelsBatchQT  
  
  
g = GLabelsBatchQT("/path/to/glabels-batch-qt")  
  
# If you call the function without the output parameter,  
# the output will be given in bytes as the result of execution  
out = g.run(
	template='path/to/template',
	copies=3,
)
print(out)
# b'%PDF-1.4\n%\xc3\xa2\xc3\.........'

# If you specify the path to the output file
out = g.run(
	template='path/to/template',  
	output="path/to/output",  
	copies=3,  
)  
print(out)  
# None  
  
# Instead of specifying the path to the template, 
# you can give it in bytes  
out = g.run(  
	template=b'...',  
	copies=3,  
)  
print(out)  
# b'%PDF-1.4\n%\xc3\xa2\xc3\.........'  
```

> Since `glabals-bath-qt` itself does not issue errors in `stdout`, `subprocess.Popen` cannot catch errors. (At least, I do not know how)
### glabels-3-batch

```python
from glabels import Glabels3Batch  
  
  
g = Glabels3Batch("/path/to/glabels-3-batch")  
  
# If you call the function without the output parameter,  
# the output will be given in bytes as the result of execution  
# Here you need to understand that there will be not only PDF in stdout  
out = g.run(  
	template='path/to/template',  
	copies=3,  
)  
  
print(out)  
# b'LABEL FILE = /path/to/template\n%PDF-1.4\n%\xc3\xa2\xc3\.........'  
  
# If you specify the path to the output file  
out = g.run(  
	template='path/to/template',  
	output="path/to/output",  
	copies=3,  
)  
print(out)  
# None  
  
# Instead of specifying the path to the template, you can give it in bytes  
out = g.run(  
	template=b'...',  
	copies=3,  
)  
print(out)  
# b'LABEL FILE = /path/to/template\n%PDF-1.4\n%\xc3\xa2\xc3\.........'
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "glabels",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Nureev Insaf",
    "author_email": "uneenymain@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c5/77/27a99ae1edd3541dfbdc075987919c67fd6e4455361745dcb6ad8d7b4f0c/glabels-0.1.3.tar.gz",
    "platform": null,
    "description": "This library is a simple wrapper around `glabels-3-batch` and `glabels-batch-qt` - extremely convenient utilities for creating labels from pre-created templates:\n\n- Glabels-3 - https://github.com/jimevins/glabels\n- Glabels-qt - https://github.com/jimevins/glabels-qt\n# Installation  \n  \n```shell\npip install glabels\n```  \n  \n# Usage  \n### glabels-batch-qt  \n  \n```python  \nfrom glabels import GLabelsBatchQT  \n  \n  \ng = GLabelsBatchQT(\"/path/to/glabels-batch-qt\")  \n  \n# If you call the function without the output parameter,  \n# the output will be given in bytes as the result of execution  \nout = g.run(\n\ttemplate='path/to/template',\n\tcopies=3,\n)\nprint(out)\n# b'%PDF-1.4\\n%\\xc3\\xa2\\xc3\\.........'\n\n# If you specify the path to the output file\nout = g.run(\n\ttemplate='path/to/template',  \n\toutput=\"path/to/output\",  \n\tcopies=3,  \n)  \nprint(out)  \n# None  \n  \n# Instead of specifying the path to the template, \n# you can give it in bytes  \nout = g.run(  \n\ttemplate=b'...',  \n\tcopies=3,  \n)  \nprint(out)  \n# b'%PDF-1.4\\n%\\xc3\\xa2\\xc3\\.........'  \n```\n\n> Since `glabals-bath-qt` itself does not issue errors in `stdout`, `subprocess.Popen` cannot catch errors. (At least, I do not know how)\n### glabels-3-batch\n\n```python\nfrom glabels import Glabels3Batch  \n  \n  \ng = Glabels3Batch(\"/path/to/glabels-3-batch\")  \n  \n# If you call the function without the output parameter,  \n# the output will be given in bytes as the result of execution  \n# Here you need to understand that there will be not only PDF in stdout  \nout = g.run(  \n\ttemplate='path/to/template',  \n\tcopies=3,  \n)  \n  \nprint(out)  \n# b'LABEL FILE = /path/to/template\\n%PDF-1.4\\n%\\xc3\\xa2\\xc3\\.........'  \n  \n# If you specify the path to the output file  \nout = g.run(  \n\ttemplate='path/to/template',  \n\toutput=\"path/to/output\",  \n\tcopies=3,  \n)  \nprint(out)  \n# None  \n  \n# Instead of specifying the path to the template, you can give it in bytes  \nout = g.run(  \n\ttemplate=b'...',  \n\tcopies=3,  \n)  \nprint(out)  \n# b'LABEL FILE = /path/to/template\\n%PDF-1.4\\n%\\xc3\\xa2\\xc3\\.........'\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Simple wrapper around glabels-3-batch and glabels-batch-qt",
    "version": "0.1.3",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9d0fb40c44121ca70cf5bd68b54de1be75439111af70d54d40cae100816f1d58",
                "md5": "f8dcd128ab392e9e8df75fdef0c81cf2",
                "sha256": "7e426347dd5b74d284bb02b6343d8219e8010ab7c0db8bc69eaf9c591af5e02a"
            },
            "downloads": -1,
            "filename": "glabels-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f8dcd128ab392e9e8df75fdef0c81cf2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 5710,
            "upload_time": "2023-10-23T14:54:31",
            "upload_time_iso_8601": "2023-10-23T14:54:31.988182Z",
            "url": "https://files.pythonhosted.org/packages/9d/0f/b40c44121ca70cf5bd68b54de1be75439111af70d54d40cae100816f1d58/glabels-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c57727a99ae1edd3541dfbdc075987919c67fd6e4455361745dcb6ad8d7b4f0c",
                "md5": "4ebbdbc02afd769ea5584e1853e968a2",
                "sha256": "e4f7573e496bd04db62e4bde1e887535790d381e4c85293f8c17cf2278ba186f"
            },
            "downloads": -1,
            "filename": "glabels-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "4ebbdbc02afd769ea5584e1853e968a2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 4024,
            "upload_time": "2023-10-23T14:54:33",
            "upload_time_iso_8601": "2023-10-23T14:54:33.285350Z",
            "url": "https://files.pythonhosted.org/packages/c5/77/27a99ae1edd3541dfbdc075987919c67fd6e4455361745dcb6ad8d7b4f0c/glabels-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-23 14:54:33",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "glabels"
}
        
Elapsed time: 0.13223s