Reads lines from a plaintext file, separated by categories.
To use use it, install the package and import on your project with
import catlist
Then read a file with
categories = catlist.catlist(file_name)
Category names are delimited by square brackets as the first and last characters of the line.
Items in each category are just plain text, one item per line
Any lines before the first category will be assigned to 'uncategorized'
The format is simmilar to .ini files, only you don't have thei 'key'='value' structure in the items.
Blank lines and lines that begin with '#' are ignored.
Example of a file:
# the following lines will be assigned to 'uncategorized`
Linux
Windows
MacOS
[Directories]
/home
/usr
/etc
# this line will be ignored
[Files]
README.md
module.py
Release files for simple-categories 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| simple-categories-0.1.2.tar.gz | 2.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| simple_categories-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.3 kB
Release files / simple-categories-0.1.2.tar.gz
| Download URL | simple-categories-0.1.2.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
442af2a9d7761bc947ab371bf09d603a740ad1a0563b536d4f8634e88fa99ca4
|
|
BLAKE2b-256 checksum How to use checksums |
f90f78fa23f573d28cc8f576102f08d9845c0c478ca58fe5eca0a03a0e2c5430
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
|
Release files / simple_categories-0.1.2-py3-none-any.whl
| Download URL | simple_categories-0.1.2-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
08a3eedf08287ae03795f47d197dc7937a101a1ccd3d96123c1be88950374179
|
|
BLAKE2b-256 checksum How to use checksums |
7d0049483e6b1a70301772ec81709a348639375c2e2116c2ebc128b11581ecac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
|