Skip to main content

PyPi version

Python 3


Logo

FoolProof

Find all exceptions that your code and its dependencies can raise, to make your work foolproof!


Report Bug

About The Project

Do you know about the "demo effect"? The fact that your well-tested code will suddently fail the moment you show it to someone? Often, it's because you forgot to handle an exception that you didn't think about.

🪨 FoolProof automatically identifies the exceptions that your code and its dependencies can raise, so you're never caught off guard again!

Getting Started

Using foolproof is very simple.

Install foolproof with pip :

pip install foolproof

To analyse an entire module mypackage, with all the functions and methods it contains, add this lines at the begginning of your code:

import foolproof
import mypackage

foolproof(mypackage)

You can also use it directly on a function:

import foolproof
from mypackage import main

foolproof(main)

(back to top)

Contributing

Ideally, I would like to add more features to foolproof, but I don't have much time for it. If you want to contribute, you're more than welcome to do so!

Roadmap/todo

Task Importance Difficulty Contributor on it Description
Adding links to file 5/5 5/5 - More than printing the raise command, we should print the link to the file in which the raise is used. This implies a major rework of foolproof, as the python ast does not keep the link between ast nodes and files.

(back to top)

How to contribute

Contributing is an awesome way to learn, inspire, and help others. Any contributions you make are greatly appreciated, even if it's just about styling and best practices.

If you have a suggestion that would make this project better, please fork the repo and create a pull request.
Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/YourAmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Author

This library was created by Nicolas MICAUX.

Acknowledgements

A lot of this code is taken from https://github.com/DontShaveTheYak/deep-ast (https://pypi.org/project/deep-ast/)
License: GNU General Public License v3 (GPLv3)
All credits goes to Levi Blaney - @shady_cuz, shadycuz@gmail.com

Release files for foolproof 0.1.8

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

Source distribution (sdist)

Source distribution for foolproof 0.1.8
File Size Uploaded
foolproof-0.1.8.tar.gz 9.0 kB Details

Release files / foolproof-0.1.8.tar.gz

Download URL foolproof-0.1.8.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
54c0f8a58b1706162dcc5c6c1214a95e0087217736568b1f8b993690f7ea05dd
BLAKE2b-256 checksum
How to use checksums
cb57ce5c54bb9a951a9915e61814da1a71568bdb1d5bfddda229c9f40ac29469
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.8 This release

1 release file

0.1.7

1 release file

0.1.6

1 release file

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