Skip to main content

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

Project description

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:

$ pip install -e .[dev]

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')])

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

pistachio-0.6.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pistachio-0.6.0-py2.py3-none-any.whl (4.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pistachio-0.6.0.tar.gz.

File metadata

  • Download URL: pistachio-0.6.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.26.0

File hashes

Hashes for pistachio-0.6.0.tar.gz
Algorithm Hash digest
SHA256 4b33b0ac2f806cb8e0c3e8873984602c622b133539a1a9a10c37e3cdd15dcc5f
MD5 37f5dd1b613e3cee44ea973e5c0b499c
BLAKE2b-256 0a711c02173b78034bd0823587e2c4a18f6e08af603db20a25dea7fcb3327b48

See more details on using hashes here.

File details

Details for the file pistachio-0.6.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pistachio-0.6.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.26.0

File hashes

Hashes for pistachio-0.6.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b9d393f993d4db578190984a18e4bcbf4ed8264439cce454345542d5518a6c68
MD5 566eaa9816f9c99b55a3f8f23c60b9a5
BLAKE2b-256 565a9b943478c386b174ab9ebcd624a6e1597b449be4501ff1f27634cfabc3a0

See more details on using hashes here.

Supported by

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