Code Monkey home page Code Monkey logo

Comments (3)

dgutman avatar dgutman commented on August 29, 2024

Heh--- so I've had this problem and it's annoying.... It's not the
number of records, it's the number of requests per second.... were you
trying to submit 20 batches of 1 record? I've had to put in a rate
limiter in the past.... and also try and submit batches of records (i.e.
a list of dictionaries) ..

On Wed, Jun 1, 2016 at 7:13 AM EliseBIBS [email protected] wrote:

Hello everybody,

I'm importing data in our REDCap server.
For the third time, my ip address was banned from REDCap.
However, I'm importing just a few data (like 20 records).
Did someone had the same issue ?
Thanks


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#69, or mute the thread
https://github.com/notifications/unsubscribe/AArhzshyC1aCbWXs8TsIuDBFa54E830Kks5qHWlBgaJpZM4Irb5p
.

David A Gutman MD PhD
Assistant Professor of Neurology, Psychiatry & Biomedical Informatics
Emory University School of Medicine
Staff Physician, Mental Health Service Line
Atlanta VA Medical Center

from pycap.

sburns avatar sburns commented on August 29, 2024

Hi Elise,

I agree with David here. Your code might be doing something like this...

project = Project(URL, TOKEN)
# compute a list of records to import
data_to_import = do_science()
for record in data_to_import:
    project.import_records([record])

# But you should do something more like
project.import_records(data_to_import)

In the first part, what ends up happening underneath the hood is that pycap will issue a separate HTTP request each time you call .import_records. This isn't bad in and of itself, but if you're doing this within a tight loop like this, this kind of HTTP traffic going to the REDCap server looks like spam, nefarious users or something else that's generally bad. Your REDCap admins seem to have some infrastructure in place to ban IP that make too many requests too quickly.

In the second part, since we only call .import_records once, only a single HTTP request is made though it carries substantially more data with it.

Hope this helps. If you find more issues, please include your code or a representative snippet (but please strip any tokens before pasting 😄 ) and we'd be more than welcome to help.

from pycap.

EliseBIBS avatar EliseBIBS commented on August 29, 2024

Hi !
I changed my code. It makes a list of dictionnaries of the data to import and call import_record once
It solved my issue !
Thanks to you both :)

from pycap.

Related Issues (20)

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.