Skip to main content

Limit time and memory usage from a function

Project description

Limit time and memory usage of a Python function

Installation

pip install flimit

Usage

from flimit.memory import limit_memory
from flimit.time import limit_time

@limit_memory(10**9)
@limit_time(60)
def f(...):  # f will have a limit of 1 Go allocation memory and 60 seconds computation time
    ...

Tests

python -m pytest tests

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

flimit-1.0.0.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

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

flimit-1.0.0-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

File details

Details for the file flimit-1.0.0.tar.gz.

File metadata

  • Download URL: flimit-1.0.0.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.1 Linux/5.11.0-27-generic

File hashes

Hashes for flimit-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7f6da7f2247f364ee57fc5a0de2ea79203d0c60ef9fba8cb074fef3eacce1064
MD5 f82a786450081f308d398a078409cc73
BLAKE2b-256 71b00e93bf4725134c589416c6bd63af17ca4e043fd3bc042ffc06ad27e9d2a7

See more details on using hashes here.

File details

Details for the file flimit-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: flimit-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.1 Linux/5.11.0-27-generic

File hashes

Hashes for flimit-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8bd875d6d836930aae2efd77a75bba9070d7bb6dd32113d77a6ad6ffd8d5b7e0
MD5 6f797d18b6755ae093db60982645212a
BLAKE2b-256 32d56e1bfd7ea99b9a24e62ee7b00b1ec7bf9a6ab2f762e2c8fb3896ea226194

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