Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

248
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda