Giter Site home page Giter Site logo

farfetch / checkarg Goto Github PK

View Code? Open in Web Editor NEW
21.0 7.0 4.0 262 KB

Guard clause library for Python projects, to validate arguments on every python function/method.

License: MIT License

Makefile 6.09% Python 93.91%
farfetch python guard-clauses hacktoberfest

checkarg's People

Contributors

claudiocn avatar dependabot[bot] avatar dinispeixoto avatar felipebrumpereira avatar tiagogandarezff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

checkarg's Issues

Add Dict validations

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Add validations for args and kwargs

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
It might not be possible

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Add readthedocs

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Add custom validators

Is your feature request related to a problem? Please describe.
After using some equivalent guard clause libraries in other programming languages, using CheckArg fills like it's completely static, without having the dynamics that some of those libraries have: the ability to accept additional validators.

This is something really important in other languages (that make use of object definitions) and their validation could be done automatically for each internal property. Although Python might not be so object-oriented, its normal usage has its own objects and when developing big projects this feature can come really handy.

Describe the solution you'd like
This feature requires discussion to have a good solution, there are different ways to handle this kind of situations, from completely manual and static validator which would be outside the CheckArg scope to a validator registration in the CheckArg, requiring it to be an instance or something else that would catalog the registered validators.

This feature request aims to have something that can be registered and directly used those custom validator from CheckArg,

Create documentation

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
Add a description to public methods on the lib

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Add Iterables/Lists validations

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Ability to chain validations

Describe the solution you'd like

def doSomethingValid(negative_number: int, positive_number: int):
    Number.is_lower(negative_number, 0).is_greater_or_equals(positive_number, 0)

Note: might not the possible

Update README

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like

  • Adapt README to dark theme users on Github
  • ...

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Remove class instantiation and use top-level functions

Is your feature request related to a problem? Please describe.
The project is a set of static methods all of them inside classes, which means that it requires an [small] instantiation whenever it's used.

Describe the solution you'd like
By removing those classes and using top-level functions instead of static methods, not only will improve the performance but also will put the project more normalized with other python packages, being more "pythonic".

Describe alternatives you've considered
Instead of using top-level functions or classes, another possibility could be a dictionary of functions, which would be a solution similar to the classes when importing the packages.

Additional context
NA

Add CI using Github Actions

Is your feature request related to a problem? Please describe.
At this moment, to use Checkarg it's required to check out the project to a subfolder and use it as a project reference.

Describe the solution you'd like
The correct solution is using it with a Dependency Manager, such as using Pipenv or Poetry, by simply pointing which project and version should be used. To do so, CheckArg needs to be deployed to Pypi. By using a Github Action, the package on Pypi will be always updated with the latest project version.

Describe alternatives you've considered
As an alternative to Github Actions prepared to automatically publish to Pypi, we could develop a CI completely manual but would require additional effort and future maintenance if Pypi usage was changed.

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.