Skip to main content

tkn

tkn is a command-line utility to quickly tokenize with tiktoken.

Installation

pip install tkn

Example usage:

$ ls
document_1.txt
document_2.txt

$ tkn document_1.txt
[tokenized version of the data]

$ tkn document_1.txt -s '\n' | wc -l
2094 # document contains 2094 tokens

$ tkn -m gpt-4 document_1.txt | tkn -m gpt-4 -d
[the contents of document_1.txt]

Metadata

Release files for tkn 0.1.2

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

Source distribution (sdist)

Source distribution for tkn 0.1.2
File Size Uploaded
tkn-0.1.2.tar.gz 1.9 kB Details

Built distribution (wheel)

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

Total release size: 4.4 kB

Release files / tkn-0.1.2.tar.gz

Download URL tkn-0.1.2.tar.gz
Size 1.9 kB
Tags Source
SHA-256 checksum
How to use checksums
01d08f3b62c73b04b7a109d287a11772aa4ed38bbac469d7ebaf4d676ace82af
BLAKE2b-256 checksum
How to use checksums
84a21baf353f609fd4cf06f03431baa9448997710a88287aec0b7b35153d0014
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.5 Darwin/22.6.0

Release files / tkn-0.1.2-py3-none-any.whl

Download URL tkn-0.1.2-py3-none-any.whl
Size 2.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e857c6013b413b87f7b1d7a3dc9cbeaa85b5bd2f2633be119ef5cd630f0f9ea5
BLAKE2b-256 checksum
How to use checksums
ccddb26400c68052a803e6c86fab7db3f2031e648ae57560e3608bbb57bef3c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.5 Darwin/22.6.0

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

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