# octk
## Utilities
### `uniquify`
Given a file path, `uniquify` will return a unique file path by appending a number to the file name if necessary.
```shell
example_dir
├── foo.txt
└── bar
└── baz.txt
```
```python
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.
```python
from octk import FileTree
tree = FileTree('example_dir')
tree.print_tree()
```
```shell
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.
```python
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']
)
```
```
Raw data
{
"_id": null,
"home_page": null,
"name": "octk",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "oakley, common, toolkit, octk, miscellaneous, directory structure",
"author": "oakla",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/ad/6c/4c49de314c90a4cf2131bb6362ab2b08a2702b8abd912d51a579dcd3c647/octk-0.1.0.tar.gz",
"platform": null,
"description": "# octk\r\n\r\n## Utilities\r\n\r\n### `uniquify`\r\nGiven a file path, `uniquify` will return a unique file path by appending a number to the file name if necessary.\r\n\r\n```shell\r\nexample_dir\r\n\u251c\u2500\u2500 foo.txt\r\n\u2514\u2500\u2500 bar\r\n \u2514\u2500\u2500 baz.txt\r\n```\r\n\r\n```python\r\nfrom octk import uniquify\r\n\r\nuniquify('example_dir/foo.txt')\r\n# 'example_dir/foo(1).txt'\r\n\r\nuniquify('example_dir/bar')\r\n# 'example_dir/bar(1)'\r\n\r\nuniquify('example_dir/bar.txt')\r\n# 'example_dir/bar.txt'\r\n```\r\n\r\n### `pytree.FileTree`\r\nCreated to work around the fact that Windows' `tree` does not allow you to exclude folders or filter files by extension.\r\n\r\n```python\r\nfrom octk import FileTree\r\n\r\ntree = FileTree('example_dir')\r\ntree.print_tree()\r\n```\r\n\r\n```shell\r\nexample_dir\r\n\u251c\u2500\u2500 foo.txt\r\n\u2514\u2500\u2500 bar\r\n \u2514\u2500\u2500 baz.txt\r\n```\r\n\r\n### `make_draft_email()`\r\nGiven 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.\r\n\r\n```python\r\nfrom octk import make_draft_email\r\n\r\nmake_draft_email(\r\n out_path='out/folder/example.eml',\r\n subject='Hello, World!',\r\n content='This is a test email.',\r\n recipients=['example@hello.com']\r\n)\r\n```\r\n```\r\n\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Oakley's Common Toolkit",
"version": "0.1.0",
"project_urls": null,
"split_keywords": [
"oakley",
" common",
" toolkit",
" octk",
" miscellaneous",
" directory structure"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "acf052f40732356b6357dc017c3776b4e34aca224ab23b7e4852adf40aa8f258",
"md5": "f1dc7af56dd04883e3659f856b2db409",
"sha256": "19b1b053601bca75fb12c0efa329d035db8c9c2393ddefaafd590951cc71e07d"
},
"downloads": -1,
"filename": "octk-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f1dc7af56dd04883e3659f856b2db409",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9773,
"upload_time": "2024-06-24T14:22:34",
"upload_time_iso_8601": "2024-06-24T14:22:34.943937Z",
"url": "https://files.pythonhosted.org/packages/ac/f0/52f40732356b6357dc017c3776b4e34aca224ab23b7e4852adf40aa8f258/octk-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ad6c4c49de314c90a4cf2131bb6362ab2b08a2702b8abd912d51a579dcd3c647",
"md5": "cf219d74e268871469b825bd49952259",
"sha256": "e79c25b0c9e780e934886dc20901c7d0374e0739af2b78e1fc03d8641caa6eec"
},
"downloads": -1,
"filename": "octk-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "cf219d74e268871469b825bd49952259",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9932,
"upload_time": "2024-06-24T14:22:40",
"upload_time_iso_8601": "2024-06-24T14:22:40.148550Z",
"url": "https://files.pythonhosted.org/packages/ad/6c/4c49de314c90a4cf2131bb6362ab2b08a2702b8abd912d51a579dcd3c647/octk-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-24 14:22:40",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "octk"
}