Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

251
Vistas
Download subset of file from s3 using Boto3

Using boto, I was able to download just a subset of a file from Amazon s3. Given an s3 key, I specified the start and stop bytes and passed them into the get_contents_as_string call.

# Define bytes to focus on
headers={'Range' : 'bytes={}-{}'.format(start_byte, stop_byte)}
resp = key.get_contents_as_string(headers=headers)

Is there a way to accomplish the same task in boto3?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You can use the same Range parameter in get_object() method:

s3 = boto3.client('s3')
resp = s3.get_object(Bucket='bucket', Range='bytes={}-{}'.format(start_byte, stop_byte))
content = resp['Body']
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda