Skip to main content

pid

https://travis-ci.org/trbs/pid.svg?branch=master https://coveralls.io/repos/trbs/pid/badge.png Latest PyPI version Number of PyPI downloads

PidFile class featuring:

  • stale detection

  • pidfile locking (fcntl)

  • chmod (default is 0o644)

  • chown

  • custom exceptions

Context Manager

PidFile can be used as a context manager:

from pid import PidFile

with PidFile():
  do_something()

Decorator

PidFile can also be used a a decorator:

from pid.decorator import pidfile

@pidfile()
def main():
  pass

if __name__ == "__main__":
  main()

Exception Order

In default mode PidFile will try to acquire a file lock before anything else. This means that normally you get a PidFileAlreadyLockedError instead of the PidFileAlreadyRunningError when running a program twice.

If you just want to know if a program is already running its easiest to catch just PidFileError since it will capture all possible PidFile exceptions.

Metadata

Release files for pid 1.1.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 pid 1.1.0
File Size Uploaded
pid-1.1.0.tar.gz 3.8 kB Details

Built distribution (wheel)

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

Total release size: 8.9 kB

Release files / pid-1.1.0.tar.gz

Download URL pid-1.1.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
590898b5bb20e85589605a0a5e124acb77ee84fa3c95910e5b81409defe3c1a5
BLAKE2b-256 checksum
How to use checksums
a4c05200173e3dba219bb890da2ff9600da766667b2a7eeb5a7602ad9ddd04ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pid-1.1.0-py2.py3-none-any.whl

Download URL pid-1.1.0-py2.py3-none-any.whl
Size 5.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ac3c5aa6e99798e2018dc9c32782f76ae3e1d7c42f04c50746dfaf6ea87d5cf0
BLAKE2b-256 checksum
How to use checksums
181b78c988741f197a9447ead816e7b44889f2024bd39d719080e8250c9fdb69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

3.0.4

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.2.5

2 release files

2.2.4

2 release files

2.2.3

1 release file

2.2.2

1 release file

2.2.1

1 release file

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.1

1 release file

2.0.0

2 release files

This release

1.1.0 This release

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.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