Skip to main content

Clojure inspired helper functions for Python

PyPI - Python Version PyPI - License PyPI

This is a small library with Clojure inspired helper functions. It uses only the standard library, without any external dependencies.

The goal is to implement replicas of the Clojure funcs that I admire.

Installation

With poetry (always recommended):

poetry add cloj

With pip:

pip install cloj

Implemented:

  • take/drop
  • take_while/drop_while
  • some
  • nth, first, second, third, fourth, fifth, forty_second, last
  • get-in

Some examples:

from cloj import take, drop

take(3, [1, 2, 3, 4, 5])
>> [1, 2, 3]

drop(3, [1, 2, 3, 4, 5])
>> [4, 5]

drop (100, [1, 2, 3, 4, 5])
>> []
from cloj import first, second, third, fourth, fifth, forty_second, last

first([1, 2, 3])
>> 1

last([1, 2, 3])
>> 3

first([])
>> None
from cloj import get_in

sample = {"foo": {"bar": [0, {"spam": "target"}, 1]}}
get_in(sample, ["foo", "bar", 1, "spam"])
>>> "target"

Metadata

Release files for cloj 0.2.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 cloj 0.2.0
File Size Uploaded Provenance Actions
cloj-0.2.0.tar.gz 3.0 kB Without provenance Details for cloj-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cloj 0.2.0
File Interpreter ABI Platform Actions
cloj-0.2.0-py3-none-any.whl Python 3 none any Details for cloj-0.2.0-py3-none-any.whl

Total release size: 6.2 kB

Release files / cloj-0.2.0.tar.gz

Download URL cloj-0.2.0.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
abe7d82d6c500e980197b3e4d0cbdc4fe0d11f7221b5513ea383cf98c2902be9
BLAKE2b-256 checksum
How to use checksums
67f45ff25b52d172b3e8b40fc7a1995d6767b0ec15fc2ed365f66814452bdd58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.7.10 Linux/5.4.0-1040-azure

Release files / cloj-0.2.0-py3-none-any.whl

Download URL cloj-0.2.0-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
216ff9cd1747c2c43b946a548ca987b8c2aea8c85b0ffd3669cebc212c1f7649
BLAKE2b-256 checksum
How to use checksums
7c949260bb2a1aead521086c29c752f0f40461a21d7e027b156c5036ef663f7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.7.10 Linux/5.4.0-1040-azure

Security for cloj 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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