semvec/pypi-packages huggingface dataset:
doublegit 1.2
Version and backup a Git repository
License: MIT
Keywords: git,versioning,version control,backup

What is this?
=============

This is a small tool that does ``git fetch`` then writes down all ref updates in a SQLite3 database. It also creates refs to make sure no commit gets garbage collected.

What for?
=========

If the remote repository gets force-pushed to, some commits might get lost. There will also be no evidence in the Git log that such destructive changes happened. It is also possible for a commit to be created but pushed much later, or branches can get renamed; none of this appears in the Git log either.

This tool will allow you to get a clear picture of what happened, never lose a commit, and quickly get a snapshot of a repository at a specific point in time. It is therefore more suitable for backups than a mirror.

Doesn't the reflog do all that?
===============================

This is indeed similar to Git's built-in reflog, except that the reflog isn't aware of branch renames, and a branch's reflog gets deleted with the branch.

It is also local, so you wouldn't be able to read the reflog of a remote repository.

How to use
==========

First, create a bare repo::

    $ mkdir my-repo-backup && cd my-repo-backup
    $ git init --bare

Set up one (or multiple) remotes to fetch from::

    $ git remote add origin https://github.com/remram44/doublegit.git

Then simply run doublegit once in a while::

    $ python3 doublegit.py /path/to/my-repo-backup

You can then query ``gitarchive.sqlite3`` for branch updates or for the position of the branches at a given point in time.

Next steps?
===========

I think it would be cool if this tool could record GitHub/GitLab/... API events too; things like issues/merge requests/comments.

It could also automatically backup all your starred repos.

This also doesn't support tags yet.
planhat 0.5.1
Python client for Planhat API
License: MIT
Requires Python: >=2.7, !=3.0.*, !=3.1.*
Keywords: planhat

Planhat Python
==============

Planhat API Python client library

https://docs.planhat.com/

## Installation

pip install planhat

## Usage

```python
from planhat import Planhat

# See https://docs.planhat.com/#base-url
from planhat import API_URL, API_URL_EU, API_URL_US2

# https://app.planhat.com/developer
planhat_client = Planhat(
    API_URL,
    'tenant-token',
    'api-token'
)

companies_data = planhat_client.get_companies()
```
spark-test 0.2.8
Assertion functions to test Spark Collections like DataFrames.
License: MIT

==========
spark-test
==========

A collection of assertion functions to test Spark Collections like DataFrames

---

As you develop Spark applications, you can eventually end up writing methods that apply transformations over Spark DataFrames. In order to test the results, you can create ``pandas`` DataFrames and use the test functions provided by ``pandas`` as ``pyspark`` does not provide any functions to assist with testing.

``spark-test`` provides testing functions similar to ``pandas`` but geared towards Spark Collections.

Let's say you have a function to apply some transformations on a Spark DataFrame (the full code for this example can be found in tests/test_example.py:

::

  def transform(df):
      """
      Fill nulls with 0, sum 10 to Age column and only return distinct rows
      """

      df = df.na.fill(0)
      df = df.withColumn('Age', df['Age'] + 10)
      df = df.distinct()

      return df

We can then write a test case with as many test inputs as we need and test the results with ``assert_dataframe_equal``:

::

  from spark_test.testing import assert_dataframe_equal


  def test_transform(spark, transform):

      input_df = spark.createDataFrame(
          [['Tom', 25], ['Tom', 25], ['Charlie', 24], ['Dan', None]],
          schema=['Name', 'Age']
      )

      expected = spark.createDataFrame(
          [['Tom', 35], ['Charlie', 34], ['Dan', 0]],
          schema=['Name', 'Age']
      )
      result = transform(input_df)

      assert_frame_equal(expected, result)

Of course, tests are more interesting when they fail so let's introduce a bug in our ``transform`` function:

::

  def bugged_transform(df):
      """
      Fill nulls with 0, sum 10 to Age column and only return distinct rows
      """

      df = df.na.fill(1)  # Whoops! Should be 0!
      df = df.withColumn('Age', df['Age'] + 10)
      df = df.distinct()

      return df

Passing both functions to our test using ``pytest.mark.parametize`` yields the following output with a nice message on what failed:

::

  $ pytest tests/example.py
  ============================= test session starts =============================
  platform linux -- Python 3.7.3, pytest-5.0.0, py-1.8.0, pluggy-0.12.0
  rootdir: /home/tfarias/repos/spark-test
  collected 2 items

  tests/example.py .F                                                [100%]

  ================================== FAILURES ===================================
  _______________________ test_transform[bugged_transform] ________________________

              assert left_d[key] == right_d[key], msg.format(
  >               field=key, l_value=left_d[key], r_value=right_d[key]
              )
  E           AssertionError: Values for Age do not match:
  E           Left=10
  E           Right=11


License
-------

Distributed under the MIT License.