Skip to main content

pistachio

Pistachio aims to simplify reoccurring tasks when working with the file system.

Developing

To install pistachio, along with the tools you need to develop and run tests, run the following in your virtualenv:

$ python -m venv env
$ source /env/bin/activate
$ pip install flit
$ flit install

Install

You can install pistachio by running the following command.

$ pip install pistachio

Usage

To use pistachio you can inport the module by running the following commands.

>>> import pistachio

Describe

Method to return a description for the resource.

>>> pistachio.describe("README.md")
Pistachio(path='README.md', exists=True, is_directory=False, is_file=True, is_symlink=False, name='README.md', stem='README', suffix='md')

Exists

You can confirm if a directory, file or symbolic link exists using the following method.

>>> pistachio.exists("README.md")
True

Get MD5 Hash

This method will return the MD5 hash string for a specific file.

>>> pistachio.get_md5_hash("README.md")
"2f853812babf98322618edeb24359591"

Is Directory

Is the resource a directory? True or False.

>>> pistachio.is_directory("README.md")
False

Is File

Is the resource a file? True or False.

>>> pistachio.is_file("README.md")
True

Is Symlink

Is the resource a symbolic link? True or False.

>>> pistachio.is_symlink("README.md")
False

Make a Symlink

Make a new symbolic link.

>>> pistachio.ln("README.txt", "README.md")
False

Make a Directory

Make a new directory or directory tree.

>>> pistachio.mkdir("src")
>>> pistachio.exists("src")
True

Touch

This method will create an empty file with a given filename and directory path.

>>> pistachio.touch("foo.bar")
True

Tree

This method will return a list of directories, files and symlinks below a specific directory.

>>> pistachio.tree("src")
Tree(path='pistachio', results=[Pistachio(path='./__init__.py', exists=True, is_directory=False, is_file=True, is_symlink=False, name='__init__.py', stem='__init__', suffix='py')])

Release files for pistachio 0.7.0

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

Source distribution (sdist)

Source distribution for pistachio 0.7.0
File Size Uploaded
pistachio-0.7.0.tar.gz 6.2 kB Details

Built distribution (wheel)

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

Total release size: 10.4 kB

Release files / pistachio-0.7.0.tar.gz

Download URL pistachio-0.7.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c1293e050c5d75086a2364ea6369f219631be2cfc3a41ea53ffc3ad2a393b0ca
BLAKE2b-256 checksum
How to use checksums
27e4ce84a58711efe511b3267ba02839ddaca8ee6bb53a75df293186cf3d95ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.27.1

Release files / pistachio-0.7.0-py2.py3-none-any.whl

Download URL pistachio-0.7.0-py2.py3-none-any.whl
Size 4.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
638bd6ac060184267af2ec2aa74630ee0db229a0ccfa7fd9fca6af7042492bcf
BLAKE2b-256 checksum
How to use checksums
8d2da0f6411a12f8eeb947b2c31d33f62bcfaf03c50f028434fba21f1b66ff55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.27.1

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

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