Giter VIP home page Giter VIP logo

pydocusign's Introduction

Build Status Documentation Status Pypi Status

pydocusign

pydocusign is a Python client for DocuSign signature SAAS platform.

Project status

pydocusign has just been created to provide Python bindings for DocuSign's API. The project is not mature yet, but authors already use it! It means that, while API and implementation may change (improve!) a bit, authors do care of the changes.

Also, help is welcome! Feel free to report issues, request features or refactoring!

Resources

pydocusign's People

Contributors

benoitbryon avatar bersace avatar edouardpoitras avatar hsmett avatar kbussell avatar moiseshiraldo avatar smcoll avatar vokracko avatar zebuline avatar

Stargazers

 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pydocusign's Issues

Add debug logging

Would be easier to debug issues by devops if we log at debug level:

  • client instanciation
  • request and response (brief or verbose)
  • maybe request and response contents if we consider that debugging is not secure.

feature request: void envelope

https://www.docusign.com/p/RESTAPIGuide/RESTAPIGuide.htm#REST%20API%20References/Void%20Envelope.htm

Essentially, this is a PUT on envelope, so supporting this feature could support some others as well. i couldn't find a succint list, and didn't see PUT for envelope at http://iodocs.docusign.com/. Here's what i found so far for other uses of that method in the REST docs:

Pydocusign overwriting an urllib3 Response method with a Requests Response method

https://github.com/novafloss/pydocusign/blob/master/pydocusign/client.py#L483

response.raw is an urllib3 response object. response.close is a method on a Requests Response object. I'm not sure why this was added in the first place, but this should not work.

It's possible that older versions of Requests and urllib3 had a bug around this, but using 2.9.0 and up, this line doesn't do anything useful and could be harmful.

DocuSignClient has default timeout option

Add timeout argument to DocuSignClient.__init__() => sets a default timeout used when performing HTTP requests.

For this feature, do not add a timeout argument to every method of the client: let's wait and see if the global timeout option is enough.

Account activation breaks automation of demo/accounts.py

At the moment, as of pydocusign version 0.10, demo/accounts.py creates an user account then deletes it.

As seen in Travis-CI.org, it used to work: see https://travis-ci.org/novapost/pydocusign/jobs/42855139#L244-L256

But now it is broken: see https://travis-ci.org/novapost/pydocusign/jobs/46837725#L287-L306
Looks like the created user account now requires activation. This step has not been automated yet.

Find a solution to pass the tests!

Here are some options:

  • automate account activation. Implies fetching and parsing email, then performing HTTP requests. Quite complicated and greedy, but should be possible.
  • create account using options so that activation is not necessary. If such options are available, should be the simplest option.
  • other ideas? Feel free to propose fixes in comments below ;)

Note: as pydocusign's maintainer I'd like to avoid mocking DocuSign, because I like the idea of having integration tests. This ticket is a typical example where integration reveals issues.

Return list of Connect failures.

GET /v2/accounts/{accountId}/connect/failures will return a list of DocuSign Connect failures (when a callback isn't adequately handled). i think i'll work up a PR shortly.

pydocusign provides utilities to extract data from DocuSign notifications

DocuSign notifications (see also #14) is XML format.
As a user of pydocusign library, I do not want to care about the XML manipulation (using beautifulsoup, lxml or whatever). I want to focus on the data.

As an example, in order to get envelope status, at the moment I must code my own solution to load and parse XML input.
The proposal is that pydocusign provides a parser/reader which has some envelope_status property.

Envelope.post_recipient_view() should not use routingOrder

As of version 0.13, Envelope.post_recipient_view() takes routingOrder as argument, whereas DocuSignClient.post_recipient_view() uses attributes like clientUserId, userId or email/userName. Moreover, in DocuSign, routingOrder is not unique. So routing_order is definitely not the most explicit attribute to select a recipient.

See also https://www.docusign.com/p/RESTAPIGuide/RESTAPIGuide.htm#REST%20API%20References/Post%20Recipient%20View.htm

support additional attributes for some objects

i was going to leave a ticket about adding support for Signer.excludedDocuments, but realized that there are actually several attributes not supported by that object. It may be cumbersome to explicitly include all sorts of untested attributes, so perhaps a compromise would be to allow the passage of additional keyword arguments into the objects on instantiation. Whatever solution would have to also be implemented in the to_dict method.

Run demo as commands

At the moment, demo scripts are not really readable and poorly usable:

  • they read environment variables, because that is something we can setup on travisci.org
  • they prompt the user for missing arguments, but the prompt is quite raw

As commands, demo scripts will get an help. Users will be able to provide arguments with options such as demo/accounts.py --integrator-key="some-key".

DocuSignClient uses DOCUSIGN_* environment variables

At the moment, test suite uses PYDOCUSIGN_TEST_* as configuration.
As pydocusign user, in order to simplify configuration process, I want DocuSignClient to use environment variables (if they are available) as default values.

In order:

  1. arguments explicitely passed to DocuSignClient() obviously have priority
  2. then if DOCUSIGN_* is available, use it
  3. else fallback to defaults

Refactor `DocuSignObject` to simplify creation and extension of objects

Issues I've run into when adding support for more DocuSign features and functionality:

  • Defining the attributes multiple times (in the attribute list and in the constructor) is overly verbose
  • Doctests for testing object serialization clutters up the code (this is more of a stylistic preference, but I tend to reserve doctests for cases where the the tests would be useful as documentation)
  • Had to create my own duplicate hierarchy of Tab objects when adding support for anchor strings

login_information() is automatically called when necessary

Given a well-configured DocuSignClient (i.e. with username, password, root URL and integrator key), when I call methods such as get_envelope_recipients(), I get an error because account_url attribute has not been initialized. This account_url attribute can be initialized via login_information() method.

Proposal: as a developer, I do not want to add explicit login_information() call everywhere I use other methods. I'd rather call methods such as get_envelope_recipients() which automatically call login_information() if account_url attribute has not been initialized yet.

Missing required meta-data: url

When releasing, the following message appears:

warning: check: missing required meta-data: url

Update Python packaging accordingly.

unexpected status code returned for DocuSignClient.add_envelope_recipients

Apparently, an add_envelope_recipients request returns a 201 response [edit: in v2 of the API] , yet the client is expecting a 200. An exception is raised:

DocuSignException: DocuSign request failed: POST https://demo.docusign.net/restapi/v2/accounts/<account>/envelopes/<envelope>/recipients returned code 201 while expecting code 200; Message: {...}

Should we be setting expected_status_code=201 in just the post for that method, or should we set that in the post method itself?

Signer model has emailNotification attribute

The emailNotification option for signers makes it possible to configure per-recipient email body, subject and language.
See reference at https://www.docusign.com/p/RESTAPIGuide/Content/REST%20API%20References/Recipients/Signers%20Recipient.htm

Important: even if in embedded signing mode (i.e. DocuSign does not send emails to recipients) language is used as the default to display DocuSign's user interface.
See http://stackoverflow.com/questions/26785088/embedded-docusign-signing-using-recipients-language

DocuSignCallbackParser.recipients_events returns recipientId and clientUserId

As of version 0.12, DocuSignCallbackParser.recipients_events returns recipient key, which is in fact mapped to clientUserId. Moreover, there is a recipientId field in callback response which is not returned by recipient_events property.
Both clientUserId and recipientId should be explicitely returned.
For backward compatibility, recipient can be kept.

feature request: add or remove recipients to/from existing envelope

Recipients can be added until the envelope is complete, although auto emails will only be sent if the new recipient's routing order hasn't already been reached: https://www.docusign.com/p/RESTAPIGuide/RESTAPIGuide.htm#REST%20API%20References/Add%20Recipients%20to%20an%20Envelope.htm

Recipients whose process has not been completed can be removed: https://www.docusign.com/p/RESTAPIGuide/RESTAPIGuide.htm#REST%20API%20References/Delete%20Recipients%20from%20an%20Envelope.htm

i intend to make a PR for this soon.

Create envelope with eventNotification argument: enable API callback

As docusign client software (typically the user interface that uses pydocusign), I want to receive notifications when signatures are updated (typically when document has been signed). At the moment, pydocusign has a "signer return URL", where the signer gets redirected after he accepted or refused a signature. But signers may not proceed the redirection. So a callback from DocuSign service itself would be appreciated. There is DocuSign Connect and "eventNotification" argument in create envelope function.

See https://www.docusign.com/p/RESTAPIGuide/RESTAPIGuide.htm#REST%20API%20References/Send%20an%20Envelope.htm

Client fetches documents in envelope

Avoid abusive calls to login_information()

Calling login_information() is not required to use DocuSign API. There is no concept of session.
At the moment, pydocusign's login_information() does completes the setup of the client: API URL and username.
Such setup could be done in initial client's constructor (__init__).
It would avoid HTTP calls.

pydocusign provides templates of DocuSign's notification callbacks

As a developer of software that uses DocuSign API via pydocusign,
in order to test the behaviour of an HTTP service that receive DocuSign's notification callbacks,
I want to fake these DocuSign's notification requests.

I do not want to follow a complete DocuSign workflow, mostly because:

  • it is quite long to create an envelope and sign it (several remote API calls)
  • it is quite hard to automatically sign a document (at the moment, I do not know howto)
  • while I'm developing a web service, it is usually unreachable from the internet, i.e. DocuSign servers won't be able to send notifications to the service...

So, I'd like the following things:

  • tools to generate requests that fake/mock/stub/whatever DocuSign's notification requests. For the body contents, templates may be a good option.
  • if possible, tests to validate that pydocusign's templates are up to date and actually look like the ones sent by DocuSign itself... At the moment, I do not know how to achieve this feature.

How do you add other tabs besides SignHereTab

            pydocusign.SignHereTab(
                documentId=1,
                pageNumber=settings.DOCUSING_SIGN_PAGE,
                xPosition=settings.DOCUSIGN_SIGN_XPOS,
                yPosition=settings.DOCUSIGN_SIGN_YPOS,

            ),

works

            pydocusign.fullNameTabs(
                name="Name",
                tabLabel="Name 1",
                pageNumber=settings.DOCUSING_SIGN_PAGE,
                xPosition=375,
                yPosition=574,
            ),

fullNameTabs, companyTabs etc is not recognized. What is the best bet to have these tabs added.

I googled and tinkered and could not find a solution. I apologize in advance if this is answered somewhere or an easy solution that I am missing

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.