Skip to main content

traitlets_paths

Traitlets module for pathlib

This package defines traitlets for all pathlib objects.

Getting Started

Install from pip:

pip install traitlets_paths

Basic Example

from traitlets import HasTraits, default
from traitlets_paths import PurePath

class Foo(HasTraits):
    path = PurePath()

    @default('path')
    def _default_path(self):
        return 'path/to/foo'


foo = Foo()
foo.path
# On Posix systems
PurePosixPath('path/to/foo')

# or on Windows systems
PureWindowsPath('path/to/foo')

How to get a TraitError

When we try passing a bad type:

foo = Foo(path=5)

we get a TraitError:

TraitError: The 'path' trait of a Foo instance must be a pathlib.PurePath trait, but a value of 5 <class 'int'> was specified.

Developing

Download and install this repo from source, and move into the base directory.

git clone https://github.com/Zsailer/traitlets_paths
cd traitlets_paths

If you use pipenv, you can install a developement version:

pipenv install --dev

Otherwise you can install a development version using pip

pip install -e .

Licensing

The code in this project is licensed under MIT license.

Metadata

Release files for traitlets-paths 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for traitlets-paths 0.1.3
File Size Uploaded
traitlets_paths-0.1.3.tar.gz 2.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for traitlets-paths 0.1.3
File Interpreter ABI Platform
traitlets_paths-0.1.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 5.8 kB

Release files / traitlets_paths-0.1.3.tar.gz

Download URL traitlets_paths-0.1.3.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a1ba6cacd220b7ba2d357ffd28488cec2c45d4bc687eab7f8bb54df1f618809a
BLAKE2b-256 checksum
How to use checksums
1561ffc36a5e8f876433fec95c880591390ff696e7e85e10fa92514252135144
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5

Release files / traitlets_paths-0.1.3-py2.py3-none-any.whl

Download URL traitlets_paths-0.1.3-py2.py3-none-any.whl
Size 3.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f72f81463ad97933ec11a5e2bea56dad37f97acde206db7528f4e85b07f9b558
BLAKE2b-256 checksum
How to use checksums
8206427ae688548d7bfa6b99b0a708ca8e81a132da7da56fa5a9f1fdea857a10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page