Skip to main content

Reads a categorized file and returns a dictionary

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simple-categories-0.1.2.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

simple_categories-0.1.2-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file simple-categories-0.1.2.tar.gz.

File metadata

  • Download URL: simple-categories-0.1.2.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for simple-categories-0.1.2.tar.gz
Algorithm Hash digest
SHA256 442af2a9d7761bc947ab371bf09d603a740ad1a0563b536d4f8634e88fa99ca4
MD5 101b50eb8ef1abdbdc0a51579acbe45c
BLAKE2b-256 f90f78fa23f573d28cc8f576102f08d9845c0c478ca58fe5eca0a03a0e2c5430

See more details on using hashes here.

File details

Details for the file simple_categories-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: simple_categories-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for simple_categories-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 08a3eedf08287ae03795f47d197dc7937a101a1ccd3d96123c1be88950374179
MD5 3468ac26f0db9c63f7d1095348d9e479
BLAKE2b-256 7d0049483e6b1a70301772ec81709a348639375c2e2116c2ebc128b11581ecac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page