Skip to main content

Oakley's Common Toolkit

Project description

octk

Utilities

uniquify

Given a file path, uniquify will return a unique file path by appending a number to the file name if necessary.

example_dir
├── foo.txt
└── bar
    └── baz.txt
from octk import uniquify

uniquify('example_dir/foo.txt')
# 'example_dir/foo(1).txt'

uniquify('example_dir/bar')
# 'example_dir/bar(1)'

uniquify('example_dir/bar.txt')
# 'example_dir/bar.txt'

pytree.FileTree

Created to work around the fact that Windows' tree does not allow you to exclude folders or filter files by extension.

from octk import FileTree

tree = FileTree('example_dir')
tree.print_tree()
example_dir
├── foo.txt
└── bar
    └── baz.txt

make_draft_email()

Given the basic information of an email (i.e. subject, content, & recipients), make_draft_email() will create a valid .eml file that can be opened and sent by an email client.

from octk import make_draft_email

make_draft_email(
    out_path='out/folder/example.eml',
    subject='Hello, World!',
    content='This is a test email.',
    recipients=['example@hello.com']
)

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

octk-0.1.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

octk-0.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file octk-0.1.0.tar.gz.

File metadata

  • Download URL: octk-0.1.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for octk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e79c25b0c9e780e934886dc20901c7d0374e0739af2b78e1fc03d8641caa6eec
MD5 cf219d74e268871469b825bd49952259
BLAKE2b-256 ad6c4c49de314c90a4cf2131bb6362ab2b08a2702b8abd912d51a579dcd3c647

See more details on using hashes here.

File details

Details for the file octk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: octk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for octk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 19b1b053601bca75fb12c0efa329d035db8c9c2393ddefaafd590951cc71e07d
MD5 f1dc7af56dd04883e3659f856b2db409
BLAKE2b-256 acf052f40732356b6357dc017c3776b4e34aca224ab23b7e4852adf40aa8f258

See more details on using hashes here.

Supported by

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