Skip to main content

Pure python perforce API

Features

  • Pythonic api to Perforce

  • Pure python, no compiled extension

Installation

pip install python-perforce

Usage

>>> import perforce
>>> p4 = perforce.connect()
>>> revisions = p4.ls('//depot/path/to/file.txt')
>>> print(revisions)
[<Revision 1: file.txt>]
>>> p4.ls('//depot/path/....txt')
[<Revision 1: file.txt>, <Revision 2: foo.txt>]
>>> cl = p4.findChangelist('my description')
>>> with cl:
...     cl.append(revisions[0])
...     p4.add('path/to/add.txt', cl)
>>> cl.description
'my description'
>>> cl.description = 'something else'
>>> cl.submit()
>>> client = perforce.Client('my_client')
>>> print(client.stream)
//streams/main
>>> print(client.root)
Path(/path/to/root)

History

0.3.17 (2016-7-28)

  • Fixed bug with windows dependent line breaks Fixes #34

  • Fixed bug while parsing unicode Fixes #32

0.3.16 (2016-5-6)

  • Fixed bug with non-unicode characters Fixes #32

  • Fixed bug with spaces in a file spec for Client and Stream Fixes #29

  • Fixed bug if any of the P4 variables were set to an empty string in a config file

0.3.15 (2016-3-9)

  • Python 3 support

0.3.14 (2016-2-24)

  • Fixed bug when trying to add an empty file

0.3.13 (2016-2-17)

  • Changed the parameter in __getVariables to a list Fixes #27

0.3.12 (2016-2-16)

  • Added an optional connection paramter to all api functions

0.3.11 (2016-2-16)

  • Added a base class for perforce objects to wrap dict getter

  • Added Stream object Fixes #25

  • Added tests for new classes Fixes #26

  • Added tests for Revision objects as it was lacking

  • __getVariables will no longer show a console on windows Fixes #24

  • Client and Stream are now exposed at the package level Fixes #23

0.3.10 (2016-1-30)

  • Added Client object

  • Added better support for finding p4 env variables

  • Added PendingDeprecationWarnings to Changelist and Revision to accept an optional Connection object. If not provided, it will use whatever settings it can find to create one

  • For Changelist, Revision, and Client, added __getattr__ to use the underlying dict to allow use of all fields if not directly supported by this lib

  • Connection.run() now requires a list instead of a string for the command. A PendingDeprecationWarning will be thrown if a string is used. Strings will not be supported in 0.4.0

0.3.9 (2016-1-29)

  • Changelist objects are lazy and will only query files as needed

0.3.7 (2015-1-7)

  • Fixed bugs regarding spaces in file names or specs

  • Fixed bug that may have left too many file handles open

  • Added comparison operator to Changelist

0.3.6 (2015-12-3)

  • Added __iadd_ operator to Changelist

  • Added unchanged_only flag to Changelist.revert()

  • Added exclude_deleted flag to Connection.ls()

  • Fixed a bug on windows that would occur if the command line was too long (>8190)

  • Added setter to Connection.client

  • Changelist.append will now raise a RevisionError if the file to append is not under the clients root

0.3.5 (2015-11-18)

  • Changed the argument order for Revisions to be consistent with everything else. Supports backwards compatible argument orders

  • Fixed bug that would attempt to checkout files when querying a changelist

0.3.4 (2015-11-17)

  • Changed enums to be namedtuples

  • Fixed bug when detecting login state

0.3.3 (2015-11-16)

  • Corrected the way the error levels were being handled

  • Added more documentation

  • Connection will no longer fail if any of the paramter were incorrect, use Connection.status() to check the status of the connection

0.1.0 (2014-10-16)

  • First release on PyPI.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-perforce-0.5.2.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

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

python_perforce-0.5.2-py2.py3-none-any.whl (13.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file python-perforce-0.5.2.tar.gz.

File metadata

  • Download URL: python-perforce-0.5.2.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.20.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.5

File hashes

Hashes for python-perforce-0.5.2.tar.gz
Algorithm Hash digest
SHA256 665f7b25a58fe0ad339451e64fd072c455af1745ffd9c103ce5e2dfa00078514
MD5 c323859debf842cc1e2c278e6681d715
BLAKE2b-256 89f360090143c8ddb84f0cb5a198e60925015c524e886b9755ba909b96fe105d

See more details on using hashes here.

File details

Details for the file python_perforce-0.5.2-py2.py3-none-any.whl.

File metadata

  • Download URL: python_perforce-0.5.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.20.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.5

File hashes

Hashes for python_perforce-0.5.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8971d37abc0bede43006feb11f2e43b8b7b6ba5fb7b2940fb18ce128c5062929
MD5 37a0a88339a29332eabced19768ff69f
BLAKE2b-256 a3c43ff9f15826e5069dc0dd353d0c3a37a85f872d2f35b8e850f8f51c78afc8

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.5.2 This release

2 files

0.3.17

1 file

0.3.15

1 file

0.3.14

1 file

0.3.13

1 file

0.3.12

1 file

0.3.11

1 file

0.3.10

1 file

0.3.9

1 file

0.3.8

1 file

0.3.7

1 file

0.3.6

1 file

0.3.5

1 file

0.3.4

1 file

0.3.3

1 file

0.3.2

1 file

0.3.1

1 file

0.3.0

1 file

0.2.4

1 file

0.2.3

1 file

0.2.1

1 file

0.2.0

1 file

0.1.0

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page