ispunct-py

A small Python library to check if a character is a punctionation character

https://github.com/jakewilliami/ispunct-py

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.5%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

A small Python library to check if a character is a punctionation character

Basic Info
  • Host: GitHub
  • Owner: jakewilliami
  • License: mit
  • Language: Python
  • Default Branch: master
  • Size: 88.9 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 2
  • Releases: 0
Created over 1 year ago · Last pushed 7 months ago
Metadata Files
Readme License Citation

README.md

ispunct

A small Python library for checking whether a character is a punctuation character.


Quick Start

```python from ispunct import ispunct

assert ispunct("?") assert not ispunct("a") assert ispunct("‽") ```

Using ispunct as a Library

This package is not published on PyPI, but you can use it from Git. For example, if using UV for dependency management, you could write:

shell $ uv add "ispunct @ git+https://github.com/jakewilliami/ispunct-py"

History

The origin of this project comes from an equivalent function to Julia's ispunct, which is itself derived from the C implementation for obtaining a Unicode character's category code. This is a more complete solution than checking against string.punctuation or curses.ascii.ispunct. There is also a StackOverflow question for this functionality which I have answered.

Notes on Internal Functionality

This library also implements (and uses internally) bitwise functions to calculate the number of leading/trailing zeros/ones in the bitwise representation of a Python integer. We also compute a Python integer that has the same bitpattern as a given character (i.e., simulating Julia's bitcast). These are required in order to determine a character's category code.

Citation

If your research depends on ispunct, please consider giving us a formal citation: citation.bib.

Owner

  • Name: Jake Ireland
  • Login: jakewilliami
  • Kind: user
  • Location: ///scary.zealous.twin

Citation (citation.bib)

@software{ireland2025ispunct,
  title={{ispunct}: A small Python library to check if a character is a punctionation character},
  author={Ireland, Jake W},
  year={2025},
  howpublished={\url{https://github.com/jakewilliami/ispunct-py}},
  note={{Python} package version 1.0.2}
}

GitHub Events

Total
  • Create event: 12
  • Issues event: 7
  • Release event: 4
  • Delete event: 2
  • Issue comment event: 4
  • Push event: 38
  • Pull request event: 4
Last Year
  • Create event: 12
  • Issues event: 7
  • Release event: 4
  • Delete event: 2
  • Issue comment event: 4
  • Push event: 38
  • Pull request event: 4

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 5
  • Total pull requests: 4
  • Average time to close issues: 1 day
  • Average time to close pull requests: 6 minutes
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 5
  • Pull requests: 4
  • Average time to close issues: 1 day
  • Average time to close pull requests: 6 minutes
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jakewilliami (5)
Pull Request Authors
  • jakewilliami (3)
Top Labels
Issue Labels
Pull Request Labels