![Alt text](EXOSIMS_cropped.png)
Exoplanet Open-Source Imaging Mission Simulator

![Build Status](https://github.com/dsavransky/EXOSIMS/actions/workflows/ci.yml/badge.svg)
[![Documentation Status](https://readthedocs.org/projects/exosims/badge/?version=latest)](https://exosims.readthedocs.io/en/latest/?badge=latest)
[![Coverage Status](https://coveralls.io/repos/github/dsavransky/EXOSIMS/badge.svg?branch=master)](https://coveralls.io/github/dsavransky/EXOSIMS?branch=master)
[![PyPI version](https://badge.fury.io/py/EXOSIMS.svg)](https://badge.fury.io/py/EXOSIMS)
[![astropy](http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat)](http://www.astropy.org/)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)

Quick Install
--------------------------
Clone the repository, navigate to the top level directory (containing setup.py) and execute:
```
pip install -e .
```
Full installation and configuration instructions available here: https://exosims.readthedocs.io/en/latest/install.html

Documentation and Quick Start Guide
-----------------------------------------------------------
- https://exosims.readthedocs.io
- https://exosims.readthedocs.io/en/latest/quickstart.html

Additional EXOSIMS tutorials are available here: https://github.com/dsavransky/YieldModelingWorkshopTutorial
This repository is associated with the Yield Modeling Tools Workshops.  For additional information, see here: https://exoplanets.nasa.gov/exep/events/456/exoplanet-yield-modeling-tools-workshop/

Contributing
-------------------------------------
All contributions are very welcome.  Before starting on your first contribution to EXOSIMS, please read the [Contributing Guide](https://github.com/dsavransky/EXOSIMS/blob/master/CONTRIBUTING.md)

Credits and Acknowledgements
------------------------------
Created by Dmitry Savransky

Written by Christian Delacroix, Daniel Garrett, Dean Keithly, Gabriel Soto, Corey Spohn, Walker Dula, Sonny Rappaport, Michael Turmon, Rhonda Morgan, Grace Genszler, and Dmitry Savransky, with contributions by Patrick Lowrance, Ewan Douglas, Jackson Kulik, Jeremy Turner, Jayson Figueroa, Owen Sorber and Neil Zimmerman.

EXOSIMS makes use of Astropy, a community-developed core Python package for Astronomy (Astropy Collaboration, 2013).

EXOSIMS optionally makes use of Forecaster (http://ascl.net/1701.007).

EXOSIMS optionally makes use of NASA's Navigation and Ancillary Information Facility's SPICE system components (https://naif.jpl.nasa.gov/naif/).

EXOSIMS optionally uses values from: Mamjek, E. "A Modern Mean Dwarf Stellar Color and Effective Temperature Sequence", http://www.pas.rochester.edu/~emamajek/EEM_dwarf_UBVIJHK_colors_Teff.txt, Version 2017.09.06

EXOSIMS development is supported by NASA Grant Nos. NNX14AD99G (GSFC), NNX15AJ67G (WPS) and NNG16PJ24C (SIT).

For further information, please see EXOSIMS's ASCL page and the following papers:
- http://adsabs.harvard.edu/abs/2016JATIS...2a1006S
- http://adsabs.harvard.edu/abs/2016SPIE.9911E..19D


Robot Operating System (ROS)
===============================================================================

ROS is a meta-operating system for your robot.  It provides
language-independent and network-transparent communication for a
distributed robot control system.

Installation Notes
------------------

For full installation instructions, including system prerequisites and
platform-specific help, see:

  http://wiki.ros.org/ROS/Installation


# peppy python package

![Run pytests](https://github.com/pepkit/peppy/workflows/Run%20pytests/badge.svg)
[![codecov](https://codecov.io/gh/pepkit/peppy/branch/master/graph/badge.svg)](https://codecov.io/gh/pepkit/peppy)
[![PEP compatible](https://pepkit.github.io/img/PEP-compatible-green.svg)](https://pep.databio.org)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

`peppy` is the official python package for reading **Portable Encapsulated Projects** or **PEP**s in Python.

Links to complete documentation:

* Complete documentation and API for the `peppy` python package is at [peppy.databio.org](https://peppy.databio.org).
* Reference documentation for standard **PEP** format is at [pep.databio.org](https://pep.databio.org/).
* Example PEPs for testing `peppy` are in the [example_peps repository](https://github.com/pepkit/example_peps).
* The package [on PyPI](https://pypi.org/project/peppy/).


###########
VCR.py 📼
###########

|PyPI| |Python versions| |Build Status| |CodeCov| |Gitter|

----

.. image:: https://vcrpy.readthedocs.io/en/latest/_images/vcr.svg
   :alt: vcr.py logo

This is a Python version of `Ruby's VCR
library <https://github.com/vcr/vcr>`__.

Source code
  https://github.com/kevin1024/vcrpy

Documentation
  https://vcrpy.readthedocs.io/

Rationale
---------

VCR.py simplifies and speeds up tests that make HTTP requests. The
first time you run code that is inside a VCR.py context manager or
decorated function, VCR.py records all HTTP interactions that take
place through the libraries it supports and serializes and writes them
to a flat file (in yaml format by default). This flat file is called a
cassette. When the relevant piece of code is executed again, VCR.py
will read the serialized requests and responses from the
aforementioned cassette file, and intercept any HTTP requests that it
recognizes from the original test run and return the responses that
corresponded to those requests. This means that the requests will not
actually result in HTTP traffic, which confers several benefits
including:

-  The ability to work offline
-  Completely deterministic tests
-  Increased test execution speed

If the server you are testing against ever changes its API, all you need
to do is delete your existing cassette files, and run your tests again.
VCR.py will detect the absence of a cassette file and once again record
all HTTP interactions, which will update them to correspond to the new
API.

Usage with Pytest
-----------------

There is a library to provide some pytest fixtures called pytest-recording https://github.com/kiwicom/pytest-recording

License
-------

This library uses the MIT license. See `LICENSE.txt <LICENSE.txt>`__ for
more details

.. |PyPI| image:: https://img.shields.io/pypi/v/vcrpy.svg
   :target: https://pypi.python.org/pypi/vcrpy
.. |Python versions| image:: https://img.shields.io/pypi/pyversions/vcrpy.svg
   :target: https://pypi.python.org/pypi/vcrpy
.. |Build Status| image:: https://github.com/kevin1024/vcrpy/actions/workflows/main.yml/badge.svg
   :target: https://github.com/kevin1024/vcrpy/actions
.. |Gitter| image:: https://badges.gitter.im/Join%20Chat.svg
   :alt: Join the chat at https://gitter.im/kevin1024/vcrpy
   :target: https://gitter.im/kevin1024/vcrpy?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
.. |CodeCov| image:: https://codecov.io/gh/kevin1024/vcrpy/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/kevin1024/vcrpy
   :alt: Code Coverage Status


:code:`passpie`: Command-line password manager
*******************************************************

.. image:: https://raw.githubusercontent.com/marcwebbie/passpie/master/images/passpie2.png
    :align: center
    :width: 100%

|Version| |Coverage|

Passpie is a command line tool to  manage passwords from the terminal with a colorful and configurable interface. Use a master passphrase to decrypt login credentials, copy passwords to clipboard, syncronize with a git repository, check the state of your passwords, and more.

Password files are encrypted using `GnuPG <https://www.gnupg.org/>`_ and saved into yaml text files. Passpie supports **Linux**, **OSX** and **Windows**.

What does it look like?  Here is an example of a simple Passpie usage::

    passpie init
    passpie add foo@example.com --random
    passpie add bar@example.com --pattern "[0-9]{5}[a-z]{5}"
    passpie update foo@example --comment "Hello"
    passpie
    passpie copy foo@example.com

Outputs::

    ===========  =======  ==========  =========
    Name         Login    Password    Comment
    ===========  =======  ==========  =========
    example.com  bar      ********
    example.com  foo      ********    Hello
    ===========  =======  ==========  =========
    Password copied to clipboard

..

    Check example remote passpie database: https://github.com/marcwebbie/passpiedb.

Install
========

.. code-block::

    pip install passpie

Or if you are on a mac, install via `Homebrew <http://brew.sh>`_:

.. code-block::

    brew install passpie

Dependencies
============

Passpie depends on `GnuPG <https://www.gnupg.org/>`_ for encryption

Commands
========

::

   Usage: passpie [OPTIONS] COMMAND [ARGS]...

   Options:
     -D, --database TEXT  Database path or url to remote repository
     --autopull TEXT      Autopull changes from remote pository
     --autopush TEXT      Autopush changes to remote pository
     --config PATH        Path to configuration file
     -v, --verbose        Activate verbose output
     --version            Show the version and exit.
     --help               Show this message and exit.

   Commands:
     add       Add new credential to database
     complete  Generate completion scripts for shells
     config    Show current configuration for shell
     copy      Copy credential password to clipboard/stdout
     export    Export credentials in plain text
     import    Import credentials from path
     init      Initialize new passpie database
     list      Print credential as a table
     log       Shows passpie database changes history
     purge     Remove all credentials from database
     remove    Remove credential
     reset     Renew passpie database and re-encrypt...
     search    Search credentials by regular expressions
     status    Diagnose database for improvements
     update    Update credential

Learn more
==========

+ Gitter: https://gitter.im/marcwebbie/passpie
+ Documentation: http://passpie.readthedocs.org
+ FAQ: http://passpie.readthedocs.org/en/latest/faq.html

Licence |License|
=================

Copyright (c) 2014-2016 Marcwebbie, <http://github.com/marcwebbie>

Full license here: `LICENSE <https://github.com/marcwebbie/passpie/blob/master/LICENSE>`_

.. |Build Status| image:: http://img.shields.io/travis/marcwebbie/passpie/master.svg?style=flat-square
   :target: https://travis-ci.org/marcwebbie/passpie
.. |Windows Build Status| image:: https://img.shields.io/appveyor/ci/marcwebbie/passpie/master.svg?style=flat-square&label=windows%20build
   :target: https://ci.appveyor.com/project/marcwebbie/passpie
.. |Coverage| image:: http://img.shields.io/coveralls/marcwebbie/passpie.svg?style=flat-square
   :target: https://coveralls.io/r/marcwebbie/passpie
.. |Gitter| image:: https://img.shields.io/gitter/room/marcwebbie/passpie.svg?style=flat-square
   :target: https://gitter.im/marcwebbie/passpie
.. |Version| image:: http://img.shields.io/pypi/v/passpie.svg?style=flat-square&label=latest%20version
   :target: https://pypi.python.org/pypi/passpie/
.. |License| image:: http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square


.. figure:: https://galaxyproject.org/images/galaxy-logos/pulsar_transparent.png
   :alt: Pulsar Logo

.. image:: https://readthedocs.org/projects/pulsar/badge/?version=latest
   :target: http://pulsar.readthedocs.io/en/latest/?badge=latest
   :alt: Documentation Status
.. image:: https://badge.fury.io/py/pulsar-app.svg
   :target: https://pypi.python.org/pypi/pulsar-app/
   :alt: Pulsar on the Python Package Index (PyPI)
.. image:: https://travis-ci.org/galaxyproject/pulsar.png?branch=master
   :target: https://travis-ci.org/galaxyproject/pulsar
   :alt: Build Status
.. image:: https://coveralls.io/repos/galaxyproject/pulsar/badge.png?branch=master
   :target: https://coveralls.io/r/galaxyproject/pulsar?branch=master
   :alt: Test Coverage

This project is a Python server application that allows a `Galaxy
<http://galaxyproject.org>`_ server to run jobs on remote systems (including
Windows) without requiring a shared mounted file systems. Unlike traditional
Galaxy job runners - input files, scripts, and config files may be transferred
to the remote system, the job is executed, and the results are transferred back
to the Galaxy server - eliminating the need for a shared file system.

Full documentation for the project can be found on `Read The Docs
<https://pulsar.readthedocs.io/>`_.

------------------
Configuring Galaxy
------------------

Galaxy job runners are configured in Galaxy's ``job_conf.xml`` file. Some small
examples of how to configure this can be found `here
<https://pulsar.readthedocs.org/en/latest/galaxy_conf.html>`__, but be sure
to check out ``job_conf.xml.sample_advanced`` in your Galaxy code base or on
`Github
<https://github.com/galaxyproject/galaxy/blob/master/config/job_conf.xml.sample_advanced>`_
for complete information.

------------------
Quickstart
------------------

Full details on different ways to install Pulsar can be found in the `install
section <https://pulsar.readthedocs.org/en/latest/install.html>`__ of the
documentaiton, but if your machine has the proper Python dependencies
available it can be quickly download and a test job run with::

    $ mkdir pulsar
    $ cd pulsar
    $ python3 -m venv venv
    $ . venv/bin/activate    # venv\Scripts\activate.bat on Windows
    $ pip install 'pulsar-app[web]'
    $ pulsar-config
    $ pulsar --daemon        # just `pulsar` on Windows
    $ pulsar-check           # runs a test job

Please note that as of the 0.14.0 release, Pulsar no longer supports any version
of Python 2. The minimum supported Python version is 3.5.

The `configuration documentation
<https://pulsar.readthedocs.org/en/latest/configure.html>`__
has many details on securing your Pulsar server and enabling advanced features
such as cluster integration and message queue communication.

-----------------------
Development and Testing
-----------------------

The recommended approach to setting up a development environment for Pulsar on
Linux or macOS is rougly as follows::

    $ git clone https://github.com/galaxyproject/pulsar
    $ cd pulsar
    $ python3 -m venv .venv
    $ . .venv/bin/activate    # .venv\Scripts\activate on Windows
    $ pip install -e '.[web]'
    $ pip install -r dev-requirements.txt

The ``-e`` flag to ``pip`` installs Pulsar in "editable" mode, meaning that
changes you make to the source code will be reflected when running the pulsar
commands installed in the virtual environment.

This project is distributed with unit and integration tests (many of which will
not run under Windows), the following command will install the needed python
components to run these tests. The following command will then run these tests::

    $ make tests

The following command will then produce a coverage report corresponding to this
test and place it in the ``coverage_html_report`` subdirectory of this
project.::

    $ coverage html

Check out the `Contributing
<https://pulsar.readthedocs.org/en/latest/contributing.html>`_ documentation
for many more details on developing and contributing to Pulsar.

Please note that this project is released with a `Contributor Code of Conduct
<https://pulsar.readthedocs.org/en/latest/conduct.html>`__. By participating
in this project you agree to abide by its terms.

-----------------------
Support
-----------------------

This documentation is an incomplete work in progress. There are more ways to
configure and use Pulsar than are documented, and a growing number of Pulsar
experts who would be more than happy to answer your questions and help with any
problems you may run in to while setting up a Pulsar deployment. Please do not
hesitate to reach out on the `Galaxy Admins Gitter Channel`_

.. _Galaxy Admins Gitter Channel: https://gitter.im/galaxyproject/admins


[![Build Status](https://travis-ci.org/alejandroautalan/pygubu.svg?branch=master)](https://travis-ci.org/alejandroautalan/pygubu)

[Leer en Español](LEEME.md)

Welcome to Pygubu!
==================

`Pygubu` is a [RAD tool](https://en.wikipedia.org/wiki/Rapid_application_development) to enable _quick_ and _easy development of user interfaces_ for the Python's `tkinter` module.

The user interfaces designed are saved as [XML](https://en.wikipedia.org/wiki/XML) files, and, by using the _pygubu builder_, these can be loaded by applications dynamically as needed.

Pygubu is inspired by [Glade](https://gitlab.gnome.org/GNOME/glade).

Installation
============

The latest version of pygubu requires Python >= 3.8

You can install pygubu using pip:

```
pip install pygubu
```

Usage
=====

Since version 0.10 the project was splitted in two main modules:

- The **pygubu core** (this project), that load and build user interfaces defined in xml.
- The **interface editor** [pygubu-designer](https://github.com/alejandroautalan/pygubu-designer), that helps you create the xml definition graphically.

Start creating your tkinter application xml UI definition using the pygubu-designer editor.

The following is a UI definition example called [helloworld.ui](https://github.com/alejandroautalan/pygubu-designer/blob/master/examples/helloworld/helloworld.ui):

```xml
<?xml version='1.0' encoding='utf-8'?>
<interface version="1.2">
  <object class="tk.Toplevel" id="mainwindow">
    <property name="height">200</property>
    <property name="resizable">both</property>
    <property name="title" translatable="yes">Hello World App</property>
    <property name="width">200</property>
    <child>
      <object class="ttk.Frame" id="mainframe">
        <property name="height">200</property>
        <property name="padding">20</property>
        <property name="width">200</property>
        <layout manager="pack">
          <property name="expand">true</property>
          <property name="side">top</property>
        </layout>
        <child>
          <object class="ttk.Label" id="label1">
            <property name="anchor">center</property>
            <property name="font">Helvetica 26</property>
            <property name="foreground">#0000b8</property>
            <property name="text" translatable="yes">Hello World !</property>
            <layout manager="pack">
              <property name="side">top</property>
            </layout>
          </object>
        </child>
      </object>
    </child>
  </object>
</interface>
```

Then, you should create your _application script_ as shown below ([helloworld.py](https://github.com/alejandroautalan/pygubu-designer/blob/master/examples/helloworld/helloworld.py)):

```python
# helloworld.py
import pathlib
import tkinter as tk
import tkinter.ttk as ttk
import pygubu

PROJECT_PATH = pathlib.Path(__file__).parent
PROJECT_UI = PROJECT_PATH / "helloworld.ui"

class HelloworldApp:
    def __init__(self, master=None):
        # 1: Create a builder and setup resources path (if you have images)
        self.builder = builder = pygubu.Builder()
        builder.add_resource_path(PROJECT_PATH)

        # 2: Load a ui file
        builder.add_from_file(PROJECT_UI)

        # 3: Create the mainwindow
        self.mainwindow = builder.get_object('mainwindow', master)

        # 4: Connect callbacks
        builder.connect_callbacks(self)

    def run(self):
        self.mainwindow.mainloop()

if __name__ == '__main__':
    app = HelloworldApp()
    app.run()

```

Note: instead of `helloworld.ui`, you should insert the _filename_ (or full path) of your UI definition:

```python
PROJECT_UI = PROJECT_PATH / "helloworld.ui"
```

Note: instead of 'mainwindow', you should have the name of your _main_widget_ (the parent of all widgets) in the following line:

```python
self.mainwindow = builder.get_object('_your_main_widget_')
```

Documentation
=============

Visit the [pygubu wiki](https://github.com/alejandroautalan/pygubu/wiki) for more documentation.

The following are some good tkinter (and tk) references:

- [TkDocs](http://www.tkdocs.com)
- [Graphical User Interfaces with Tk](https://docs.python.org/3/library/tk.html)
- [Tkinter 8.5 reference: a GUI for Python](https://tkdocs.com/shipman)
- [An Introduction to Tkinter](http://effbot.org/tkinterbook) [(archive)](http://web.archive.org/web/20200504141939/http://www.effbot.org/tkinterbook)
- [Tcl/Tk 8.5 Manual](http://www.tcl.tk/man/tcl8.5/)

You can also see the [examples](https://github.com/alejandroautalan/pygubu-designer/tree/master/examples) directory or watch [this introductory video tutorial](http://youtu.be/wuzV9P8geDg).

History
=======

See the list of changes [here](HISTORY.md).


![PySceneDetect](https://raw.githubusercontent.com/Breakthrough/PySceneDetect/main/website/pages/img/pyscenedetect_logo_small.png)
==========================================================
Video Cut Detection and Analysis Tool
----------------------------------------------------------

[![Build Status](https://img.shields.io/github/actions/workflow/status/Breakthrough/PySceneDetect/build.yml)](https://github.com/Breakthrough/PySceneDetect/actions)
[![PyPI Status](https://img.shields.io/pypi/status/scenedetect.svg)](https://pypi.python.org/pypi/scenedetect/)
[![PyPI Version](https://img.shields.io/pypi/v/scenedetect?color=blue)](https://pypi.python.org/pypi/scenedetect/)
[![PyPI License](https://img.shields.io/pypi/l/scenedetect.svg)](https://scenedetect.com/copyright/)

----------------------------------------------------------

### Latest Release: v0.6.4 (June 10, 2024)

**Website**:  [scenedetect.com](https://www.scenedetect.com)

**Quickstart Example**: [scenedetect.com/cli/](https://www.scenedetect.com/cli/)

**Documentation**:  [scenedetect.com/docs/](https://www.scenedetect.com/docs/)

**Discord**: https://discord.gg/H83HbJngk7

----------------------------------------------------------

**Quick Install**:

    pip install scenedetect[opencv] --upgrade

Requires ffmpeg/mkvmerge for video splitting support. Windows builds (MSI installer/portable ZIP) can be found on [the download page](https://scenedetect.com/download/).

----------------------------------------------------------

**Quick Start (Command Line)**:

Split input video on each fast cut using `ffmpeg`:

    scenedetect -i video.mp4 split-video

Save some frames from each cut:

    scenedetect -i video.mp4 save-images

Skip the first 10 seconds of the input video:

    scenedetect -i video.mp4 time -s 10s

More examples can be found throughout [the documentation](https://www.scenedetect.com/docs/latest/cli.html).

**Quick Start (Python API)**:

To get started, there is a high level function in the library that performs content-aware scene detection on a video (try it from a Python prompt):

```python
from scenedetect import detect, ContentDetector
scene_list = detect('my_video.mp4', ContentDetector())
```

`scene_list` will now be a list containing the start/end times of all scenes found in the video.  There also exists a two-pass version `AdaptiveDetector` which handles fast camera movement better, and `ThresholdDetector` for handling fade out/fade in events.

Try calling `print(scene_list)`, or iterating over each scene:

```python
from scenedetect import detect, ContentDetector
scene_list = detect('my_video.mp4', ContentDetector())
for i, scene in enumerate(scene_list):
    print('    Scene %2d: Start %s / Frame %d, End %s / Frame %d' % (
        i+1,
        scene[0].get_timecode(), scene[0].get_frames(),
        scene[1].get_timecode(), scene[1].get_frames(),))
```

We can also split the video into each scene if `ffmpeg` is installed (`mkvmerge` is also supported):

```python
from scenedetect import detect, ContentDetector, split_video_ffmpeg
scene_list = detect('my_video.mp4', ContentDetector())
split_video_ffmpeg('my_video.mp4', scene_list)
```

For more advanced usage, the API is highly configurable, and can easily integrate with any pipeline. This includes using different detection algorithms, splitting the input video, and much more. The following example shows how to implement a function similar to the above, but using [the `scenedetect` API](https://www.scenedetect.com/docs/latest/api.html):

```python
from scenedetect import open_video, SceneManager, split_video_ffmpeg
from scenedetect.detectors import ContentDetector
from scenedetect.video_splitter import split_video_ffmpeg

def split_video_into_scenes(video_path, threshold=27.0):
    # Open our video, create a scene manager, and add a detector.
    video = open_video(video_path)
    scene_manager = SceneManager()
    scene_manager.add_detector(
        ContentDetector(threshold=threshold))
    scene_manager.detect_scenes(video, show_progress=True)
    scene_list = scene_manager.get_scene_list()
    split_video_ffmpeg(video_path, scene_list, show_progress=True)
```

See [the documentation](https://www.scenedetect.com/docs/latest/api.html) for more examples.

## Reference

 - [Documentation](https://www.scenedetect.com/docs/) (covers application and Python API)
 - [CLI Example](https://www.scenedetect.com/cli/)
 - [Config File](https://www.scenedetect.com/docs/0.6.4/cli/config_file.html)

## Help & Contributing

Please submit any bugs/issues or feature requests to [the Issue Tracker](https://github.com/Breakthrough/PySceneDetect/issues). Before submission, ensure you search through existing issues (both open and closed) to avoid creating duplicate entries.
Pull requests are welcome and encouraged.  PySceneDetect is released under the BSD 3-Clause license, and submitted code should be compliant.

For help or other issues, you can join [the official PySceneDetect Discord Server](https://discord.gg/H83HbJngk7), submit an issue/bug report [here on Github](https://github.com/Breakthrough/PySceneDetect/issues), or contact me via [my website](http://www.bcastell.com/about/).

## Code Signing

This program uses free code signing provided by [SignPath.io](https://signpath.io?utm_source=foundation&utm_medium=github&utm_campaign=PySceneDetect), and a free code signing certificate by the [SignPath Foundation](https://signpath.org?utm_source=foundation&utm_medium=github&utm_campaign=PySceneDetect)

## License

BSD-3-Clause; see [`LICENSE`](LICENSE) and [`THIRD-PARTY.md`](THIRD-PARTY.md) for details.

----------------------------------------------------------

Copyright (C) 2014-2024 Brandon Castellano.
All rights reserved.


.. |ci| image:: https://github.com/alisaifee/limits/workflows/CI/badge.svg?branch=master
    :target: https://github.com/alisaifee/limits/actions?query=branch%3Amaster+workflow%3ACI
.. |codecov| image:: https://codecov.io/gh/alisaifee/limits/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/alisaifee/limits
.. |pypi| image:: https://img.shields.io/pypi/v/limits.svg?style=flat-square
    :target: https://pypi.python.org/pypi/limits
.. |pypi-versions| image:: https://img.shields.io/pypi/pyversions/limits?style=flat-square
    :target: https://pypi.python.org/pypi/limits
.. |license| image:: https://img.shields.io/pypi/l/limits.svg?style=flat-square
    :target: https://pypi.python.org/pypi/limits
.. |docs| image:: https://readthedocs.org/projects/limits/badge/?version=latest
   :target: https://limits.readthedocs.org

limits
------
|docs| |ci| |codecov| |pypi| |pypi-versions| |license|

**limits** is a python library to perform rate limiting with commonly used storage backends (Redis, Memcached, MongoDB & Etcd).

Supported Strategies
====================
`Fixed Window <https://limits.readthedocs.io/en/latest/strategies.html#fixed-window>`_
   This strategy resets at a fixed interval (start of minute, hour, day etc).
   For example, given a rate limit of ``10/minute`` the strategy will:

   - Allow 10 requests between ``00:01:00`` and ``00:02:00``
   - Allow 10 requests at ``00:00:59`` and 10 more requests at ``00:01:00``

`Fixed Window (Elastic) <https://limits.readthedocs.io/en/latest/strategies.html#fixed-window-with-elastic-expiry>`_
   Identical to Fixed window, except every breach of rate limit results in an extension
   to the time out. For example a rate limit of `1/minute` hit twice within a minute will
   result in a lock-out for two minutes.

`Moving Window <https://limits.readthedocs.io/en/latest/strategies.html#moving-window>`_
   Sliding window strategy enforces a rate limit of N/(m time units)
   on the **last m** time units at the second granularity.

   For example, with a rate limit of ``10/minute``:

   - Allow 9 requests that arrive at ``00:00:59``
   - Allow another request that arrives at ``00:01:00``
   - Reject the request that arrives at ``00:01:01``

Storage backends
================

- `Redis <https://limits.readthedocs.io/en/latest/storage.html#redis-storage>`_
- `Memcached <https://limits.readthedocs.io/en/latest/storage.html#memcached-storage>`_
- `MongoDB <https://limits.readthedocs.io/en/latest/storage.html#mongodb-storage>`_
- `Etcd <https://limits.readthedocs.io/en/latest/storage.html#etcd-storage>`_
- `In-Memory <https://limits.readthedocs.io/en/latest/storage.html#in-memory-storage>`_

Dive right in
=============

Initialize the storage backend

.. code-block:: python

   from limits import storage
   memory_storage = storage.MemoryStorage()
   # or memcached
   memcached_storage = storage.MemcachedStorage("memcached://localhost:11211")
   # or redis
   redis_storage = storage.RedisStorage("redis://localhost:6379")
   # or use the factory
   storage_uri = "memcached://localhost:11211"
   some_storage = storage.storage_from_string(storage_uri)

Initialize a rate limiter with the Moving Window Strategy

.. code-block:: python

   from limits import strategies
   moving_window = strategies.MovingWindowRateLimiter(memory_storage)

Initialize a rate limit

.. code-block:: python

    from limits import parse
    one_per_minute = parse("1/minute")

Initialize a rate limit explicitly

.. code-block:: python

    from limits import RateLimitItemPerSecond
    one_per_second = RateLimitItemPerSecond(1, 1)

Test the limits

.. code-block:: python

    assert True == moving_window.hit(one_per_minute, "test_namespace", "foo")
    assert False == moving_window.hit(one_per_minute, "test_namespace", "foo")
    assert True == moving_window.hit(one_per_minute, "test_namespace", "bar")

    assert True == moving_window.hit(one_per_second, "test_namespace", "foo")
    assert False == moving_window.hit(one_per_second, "test_namespace", "foo")
    time.sleep(1)
    assert True == moving_window.hit(one_per_second, "test_namespace", "foo")

Check specific limits without hitting them

.. code-block:: python

    assert True == moving_window.hit(one_per_second, "test_namespace", "foo")
    while not moving_window.test(one_per_second, "test_namespace", "foo"):
        time.sleep(0.01)
    assert True == moving_window.hit(one_per_second, "test_namespace", "foo")

Links
=====

* `Documentation <http://limits.readthedocs.org/en/latest>`_
* `Changelog <http://limits.readthedocs.org/en/stable/changelog.html>`_


# Foolscap

[![PyPI](http://img.shields.io/pypi/v/foolscap.svg)](https://pypi.python.org/pypi/foolscap)
[![Build Status](https://travis-ci.org/warner/foolscap.svg?branch=master)](https://travis-ci.org/warner/foolscap)

Foolscap is an RPC/RMI (Remote Procedure Call / Remote Method Invocation)
protocol for use with Twisted, derived/inspired by Twisted's built-in
"Perspective Broker" package.

If you have control of both ends of the wire, and are thus not constrained to
use some other protocol like HTTP/XMLRPC/CORBA/etc, you might consider using
Foolscap.

Fundamentally, Foolscap allows you to make a python object in one process
available to code in other processes, which means you can invoke its methods
remotely. This includes a data serialization layer to convey the object
graphs for the arguments and the eventual response, and an object reference
system to keep track of which objects you are connecting to. It uses a
capability-based security model, such that once you create a non-public
object, it is only accessible to clients to whom you've given the
(unguessable) FURL. You can of course publish world-visible objects that
have well-known FURLs.

Full documentation and examples are in the doc/ directory.

## DEPENDENCIES

* Python 3.8 or higher
* Twisted 16.0.0 or later
* PyOpenSSL (tested against 16.0.0)

## INSTALLATION

To install foolscap into your system's normal python library directory, just
run the following (you will probably have to do this as root):

```
pip install .
```

You can also just add the foolscap source tree to your PYTHONPATH, since
there are no compile steps or .so/.dll files involved.

## COMPATIBILITY

Foolscap's wire protocol is unlikely to change in the near future.

Foolscap has a built-in version-negotiation mechanism that allows the two
processes to determine how to best communicate with each other. The two ends
will agree upon the highest mutually-supported version for all their
traffic. If they do not have any versions in common, the connection will
fail with a NegotiationError.

Please check the NEWS file for announcements of compatibility-breaking
changes in any given release.

As of Foolscap-0.14.0, this library is mostly compatible with Python 3
(specifically 3.5 or higher), and is tested against 3.5, 3.6, 3.7, and 3.8.
It will retain compatibility with Python 2.7 for a little while longer, to
ease the transition, but since Python 2 was marked End-Of-Life in January
2020, this compatibility will not be maintained forever.

## HISTORY

Foolscap is a rewrite of the Perspective Broker protocol provided by Twisted
(in the twisted.pb package), with the goal of improving serialization
flexibility and connection security. It also adds features to assist
application development, such as distributed/incident-triggered logging,
Service management, persistent object naming, and debugging tools.

For a brief while, it was intended to replace Perspective Broker, so it had
a name of "newpb" or "pb2". However we no longer expect Foolscap to ever be
added to the Twisted source tree.

A "foolscap" is a size of paper, probably measuring 17 by 13.5 inches. A
twisted foolscap of paper makes a good fool's cap. Also, "cap" implies
capabilities, and Foolscap is a protocol to implement a distributed
object-capabilities model in python.

## AUTHOR

Brian Warner is responsible for this thing. Please discuss it on the
twisted-python mailing list.

The Foolscap home page is a Trac instance at
<http://foolscap.lothar.com/trac>. It contains pointers to the latest
release, bug reports, patches, documentation, and other resources.

Foolscap is distributed under the same license as Twisted itself, namely the
MIT license. Details are in the LICENSE file.